fix(sdk): stream should terminate after consumer shutdown - #3964
Open
haubur wants to merge 1 commit into
Open
Conversation
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3964 +/- ##
=============================================
- Coverage 83.99% 69.85% -14.14%
Complexity 1358 1358
=============================================
Files 1215 1215
Lines 170548 146083 -24465
Branches 138292 113829 -24463
=============================================
- Hits 143252 102049 -41203
- Misses 23439 40131 +16692
- Partials 3857 3903 +46
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR address?
Closes #3910
Rationale
After
consumer.shutdown()calling consumer.next() was still possible. CausingWhat changed?
When writing the issue I said that the preferred way would be to return an IggyError to allow user handling.
However, calling next() on a shut down consumer now returns:
Poll::Ready(None)indicating a terminated stream as intended by the futures crate: https://docs.rs/futures/latest/futures/prelude/trait.Stream.html#:~:text=Poll%3A%3AReady%28None%29%20means%20that%20the%20stream%20has%20terminated%2C%20and%20poll%5Fnext%20should%20not%20be%20invoked%20againLocal Execution