feat: add permit APIs and notification_capacity to HandlerCtx#40
Merged
feat: add permit APIs and notification_capacity to HandlerCtx#40
Conversation
Expose backpressure-aware permit APIs on HandlerCtx that mirror tokio's mpsc::Sender reserve surface. Users can now reserve channel capacity before sending, with both borrowed and owned permit types. New types: NotifyPermit, OwnedNotifyPermit New methods: permit, permit_owned, try_permit, try_permit_owned, permit_many, try_permit_many, notification_capacity Co-Authored-By: Claude Opus 4.6 <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.
Summary
NotifyPermit(borrowed) andOwnedNotifyPermit(owned) types that wrap tokio mpsc permits with a tracing span, providing synchronoussendonce a channel slot is reservedpermit,permit_owned,try_permit,try_permit_owned,permit_many, andtry_permit_manymethods toHandlerCtxfor backpressure-aware notification sendingnotification_capacityto expose the max channel capacityTest plan
cargo clippy -p ajj --all-features --all-targetspassescargo clippy -p ajj --no-default-features --all-targetspassescargo +nightly fmtcleancargo t -p ajj— all 18 tests + 18 doc-tests pass🤖 Generated with Claude Code