-
Notifications
You must be signed in to change notification settings - Fork 488
Create streaming interface for client streaming. #2504
Conversation
Signed-off-by: Michael Stergianis <mstergianis@vmware.com>
There was some incorrect error handling in my last commit. When fixing that I noticed that I slightly changed the semantics of the websocket read pump when I moved unmarshaling to be a client.Recieve responsibility. So I introduced a new concept that a stream client can return a fatal error, and read pump can react to that appropriately. This paves the way for read pump to become a function owned by the streaming client manager instead of a method on websocket client. Signed-off-by: Michael Stergianis <mstergianis@vmware.com>
- change for loop semantics in (*StreamingConnectionManager).Run Signed-off-by: Michael Stergianis <mstergianis@vmware.com>
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
@@ -0,0 +1,22 @@ | |||
package api | |||
|
|||
type StreamError struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could go under internal/errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requesting one change so that library consumers can effectively use this handy feature!
@@ -215,15 +216,23 @@ func WithClusterClient(client cluster.ClientInterface) RunnerOption { | |||
} | |||
} | |||
|
|||
func WithStreamingClientFactory(factory api.StreamingClientFactory) RunnerOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the package api
in this context is an internal package -- for library consumers to use this option the StreamingClientFactory
type will need to be moved into a non-internal package please!
EDIT: similarly for the default websocket implementation, please
@wwitzel3 happy to resolve the above two requests. I'll send you a patch |
@wwitzel3 in going through the exercise of resolving the requests; I realized that |
Making Eventually, |
Okay, sounds good to me. I'll set aside some time to do this today and get back to you with some patches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to suggest that we move the generation of IDs into the connection factory itself -- it reduces the surface area of the connection factory interface and allows custom implementations (like the one I'd like to write) to manage their own IDs.
Co-authored-by: Jamie Klassen <jklassen@vmware.com>
replaced by #2581 |
What this PR does / why we need it:
Extracts the current websocket streaming in to an interface that can be replaced.
This work was done by @mstergianis in #1905 this PR is just addressing the merge conflict.