Skip to content

Close unawaited watcher coroutines when messages are dropped - #104

Merged
trissim merged 2 commits into
mainfrom
fix/native-reactive-callback-retirement-20261007
Oct 7, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/native-reactive-callback-retirement-20261007

Conversation

@trissim

@trissim trissim commented Oct 7, 2026 •

Copy link
Copy Markdown

Reactive watchers that return coroutines could leave them never awaited when the delivery was rejected, abandoned or still queued at shutdown. The watcher callback now owns its coroutine and gets a _discard hook, which the message pump calls for rejected messages, unrun next-callbacks, and queued messages when the pump exits or is destroyed unstarted. The old free await helper in reactive.py is removed. Tests are added to test_reactive.py.

@trissim
trissim marked this pull request as ready for review October 7, 2026 22:02
Copilot AI balanced review requested due to automatic review settings October 7, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trissim
trissim merged commit a51ba8f into main Oct 7, 2026
2 of 22 checks passed
@trissim trissim changed the title Close abandoned reactive watcher coroutines through callback ownership Close unawaited watcher coroutines when messages are dropped Oct 11, 2026
@trissim
trissim deleted the fix/native-reactive-callback-retirement-20261007 branch October 11, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants