This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author achimnol
Recipients achimnol, asvetlov, gvanrossum, yselivanov
Date 2022-02-25.04:58:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645765116.66.0.384556133567.issue46843@roundup.psfhosted.org>
In-reply-to
Content
I ended up with the following conclusion:
- The new abstraction should not cancel sibling tasks and itself upon unhandled execption but loudly report such errors (and the fallback error handler should be customizable).
- Nesting task groups will give additional benefits such as orderly shutdown of different task groups.  Empty up message queues before shutting down netweork connections, etc.

You may take my suggestion as "let's have a hierarchical nested virtual event loops to group tasks".  PersistentTaskGroup actually shares many characteristics with the event loop while itself is not an event loop.

So I came up with WeakSet with task decorators to handle exceptions by my own, and this is the current rudimentary implementation of PersistentTaskGroup in aiotools.

And I discovered from the additional search results that the same pattern ---managing sporadic tasks using WeakSet and writing a proper cancellation loop of them---appear quite commonly in many different asyncio applications and libraries.

So that's why I think this should be an intrinsic/essential abstraction.
History
Date User Action Args
2022-02-25 04:58:36achimnolsetrecipients: + achimnol, gvanrossum, asvetlov, yselivanov
2022-02-25 04:58:36achimnolsetmessageid: <1645765116.66.0.384556133567.issue46843@roundup.psfhosted.org>
2022-02-25 04:58:36achimnollinkissue46843 messages
2022-02-25 04:58:36achimnolcreate