Message413358
I'm not trying to argue that asyncio should be changed to have level cancellation or even cancel scopes as built-in (at this point), but expanding the low level API to make implementing these features possible in third party libraries without the awkward hacks we have now.
As for async-timeout, it suffers from the same problem as AnyIO and Quattro: that cancellations of the entire task can be inadvertently swallowed by the async context manager in edge cases. I hadn't even thought of the possibility of this happening until one of AnyIO's users reported just such a problem: https://github.com/agronholm/anyio/issues/374
I just couldn't think of any way to correctly support such things without at least _some_ changes to the task cancellation behavior, and allowing .cancel() to update the cancel message seemed like the least invasive option. I'm all ears if someone has a better solution. |
|
Date |
User |
Action |
Args |
2022-02-16 21:10:57 | alex.gronholm | set | recipients:
+ alex.gronholm, gvanrossum, njs, jab, asvetlov, yselivanov, tinchester, iritkatriel |
2022-02-16 21:10:57 | alex.gronholm | set | messageid: <1645045857.43.0.37310327873.issue46771@roundup.psfhosted.org> |
2022-02-16 21:10:57 | alex.gronholm | link | issue46771 messages |
2022-02-16 21:10:57 | alex.gronholm | create | |
|