Conversation
…op dead branch - Cache total_pending as a counter on _StreamingState instead of summing partition lengths every loop iteration (#5). - Run per-consumer commits via asyncio.gather so multi-consumer setups overlap their network round-trips. Single-consumer (the common case) is unchanged in cost (#7). - Remove the always-true `if self._limiter:` branch in handle_task; the ctor enforces concurrency_limit >= 1, and Semaphore is always truthy (#8). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the per-commit asyncio.sleep Task with a float deadline on _StreamingState. asyncio.wait already accepts a `timeout=` argument; passing `max(deadline - loop.time(), 0.0)` removes one Task allocation per commit plus the matching cancel-on-reset. The timer is no longer in the wait set, so the per-iteration callback registration cost goes away too. Behavior is unchanged: pending empty ⇒ deadline is None (no timer); deadline is set on the first task absorbed into empty pending; reset to a fresh interval after every commit while pending still has tasks; cleared when pending drains. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
No description provided.