-
Notifications
You must be signed in to change notification settings - Fork 9
Description
What happened?
When we wrote this library, we didn't fully understand the details of asyncio and how to do cleanup and cancellation properly. It is not a surprise, as this can be extremely tricky and the documention for asyncio is not great at specifying this. Because of this we ended up with some code that either is not cleaning up properly, or it is hard to clean up properly.
What did you expect instead?
Things to be more robust and clean up properly.
Affected version(s)
No response
Affected part(s)
Channels, Broadcast, Anycast, etc. (part:channels), Core types (Sender, Receiver, exceptions, etc.) (part:core), Experimental features (the experimental package) (part:experimental), Utilities (Event, FileWatcher, Timer, etc.) (part:utilities), Synchronization of multiple sources (select(), merge(), etc.) (part:synchronization)
Extra information
We should fix at least these:
- Remove all
__del__methods - Make all classes that need cleanup a (async) context manager
- Make
select()an async context manager (make the function use the context manager and deprecate it) - Research if every call to
awaitis a checkpoint. If not, we should probably add checkpoints to allasyncfunctions