chore(pubsub): Add inventory wait and stream shutdown nack - #36479
Open
aandreassa wants to merge 2 commits into
Open
chore(pubsub): Add inventory wait and stream shutdown nack#36479aandreassa wants to merge 2 commits into
aandreassa wants to merge 2 commits into
Conversation
Adds internal primitives in `Inventory` and `Stream` in preparation for exposing subscriber shutdown options in a follow-up change: 1. Added `Inventory#wait_until_empty(timeout)` to block until messages finish processing or time out. 2. Updated `Stream#stop` and `Stream#wait!` to support immediate nacking and waiting for message processing to complete. 3. Added unit tests in `inventory_test.rb` and `stream_test.rb`.
torreypayne
requested changes
Aug 28, 2026
torreypayne
left a comment
Member
There was a problem hiding this comment.
Can you also include some context from the design docs on what this is solving/how it rolls up to the larger initiative?
- Allow sequencer to dispatch subsequent ordered messages during wait_for_processing - Budget timeout across inventory and callback thread pool in wait! - Interrupt inventory wait_until_empty when stopped - Add unit tests for ordered message shutdown, timeout budgeting, and inventory stop
Contributor
Author
|
@torreypayne thanks for the feedback. What kind of context were you hoping for? Today, stopping a subscriber abandons buffered messages in memory without NACKing them, leaving them in limbo until server-side ack deadlines expire, while queued callbacks are abruptly dropped. This initiative introduces two standard behaviors:
I am adding some docs in the last PR as well! |
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.
Adds internal primitives in
InventoryandStreamin preparation for exposing subscriber shutdown options in a follow-up change:Inventory#wait_until_empty(timeout)to block until messages finish processing or time out.Stream#stopandStream#wait!to support immediate nacking and waiting for message processing to complete.inventory_test.rbandstream_test.rb.