-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Clean up handling of Handles #76
Merged
Merged
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
Member
oremanj
commented
May 3, 2020
•
edited
Loading
edited
- Use regular asyncio.Handle and asyncio.TimerHandle in most cases, reserving our custom extensions for the few places that actually need the extra features
- Name our extended handles in a way that clarifies what features they provide: ScopedHandle and AsyncHandle (also, two types rather than one type with a flag that changes its behavior and valid methods)
- Remove the logic for cancelling a Task when a handle for its next step is cancelled; this was never invoked in the test suite and it's not clear to me what it's intended to help with. (@smurfix can you provide any historical perspective on the rationale for this logic? It was added in 21f4096 "Fix hang-on-close tests")
- Move the logic for propagating the result of an async handle to a Future into the handle code (allows us to remove the "is_sync=None" special case for invoking the callback with its handle as argument) and robustify it; it should correctly handle MultiErrors now
- Run async handles' callbacks (trio_as_aio tasks) in a copy of the contextvars context that was current when creating them. The previous code appeared to do this, but didn't actually.
oremanj
commented
May 3, 2020
smurfix
reviewed
May 3, 2020
Codecov Report
@@ Coverage Diff @@
## master #76 +/- ##
==========================================
+ Coverage 78.05% 79.90% +1.84%
==========================================
Files 11 11
Lines 1285 1229 -56
Branches 180 171 -9
==========================================
- Hits 1003 982 -21
+ Misses 204 173 -31
+ Partials 78 74 -4
|
pquentin
approved these changes
May 11, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was referenced Jan 1, 2021
Merged
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.