Streaming connections are now closed when you call Close on a client #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Close wasn't closing streaming connections which meant they would stay open forever.
Testing
Started up the sample sdk locally with it pointing at this version of the SDK and had it stream for a period of time before calling
Close
. BeforeClose
was called I could see streamed events in the logs when I toggled a flag on/off and afterClose
was called I was not seeing streamed events in the logs whenever I toggled a flag on/offThe unit test for this is a bit light but I can't see a way to do anything more thorough without extensively refactoring the code in the client. Ideally if we could break the logic in the client out into smaller components we would be able to define some interfaces for the separate bits of logic that the client is doing e.g.
Then we could have some mocks for these which would let us verify that the
Close
functionality is actually sending a close signal to each of these components.