-
Notifications
You must be signed in to change notification settings - Fork 149
add notify_closing #896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add notify_closing #896
Conversation
This file contains 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
store the closed attribute of waiting sockets separately from selector registration this is because the selector registration status bool is not returned from uvloop remove_reader or remove_writer, and the Selector thread always removes registration before waking the calling event loop
470c17b
to
af37214
Compare
graingert
commented
Mar 18, 2025
graingert
commented
Mar 18, 2025
agronholm
requested changes
Mar 18, 2025
Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
So, two questions came to mind:
|
that seems nicer, and allows new readers/writers slightly sooner. I've pushed that - it's a bit more complex though
using a future for handling exceptions results in a reference cycle attached to a traceback and I'd like to avoid this. Also the traceback is harder to debug |
agronholm
approved these changes
Apr 13, 2025
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.
Changes
anyio-zmq needs this feature to handle ZmqSocket.close calls
we expose the trio implemenation which is simple enough, and emulate the feature on asyncio. If someone is using add_reader themselves on an FD then you can't use it with anyio wait_readable/wait_writiable/notify_closing
Checklist
If this is a user-facing code change, like a bugfix or a new feature, please ensure that
you've fulfilled the following conditions (where applicable):
tests/
) added which would fail without your patchdocs/
, in case of behavior changes or newfeatures)
docs/versionhistory.rst
).If this is a trivial change, like a typo fix or a code reformatting, then you can ignore
these instructions.
Updating the changelog
If there are no entries after the last release, use
**UNRELEASED**
as the version.If, say, your patch fixes issue #123, the entry should look like this:
If there's no issue linked, just link to your pull request instead by updating the
changelog after you've created the PR.