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-24.05:45:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645681556.47.0.510927748304.issue46844@roundup.psfhosted.org>
In-reply-to
Content
Along with bpo-46843 and the new asyncio.TaskGroup API, I would like to suggest addition of context-based TaskGroup feature.

Currently asyncio.create_task() just creates a new task directly attached to the event loop, while asyncio.TaskGroup.create_task() creates a new task managed by the TaskGroup instance.

It would be ideal to all existing asyncio codes to migrate to use TaskGroup, but this is impractical.

An alternative approach is to implicitly bind asyncio.create_task() under a specific context to a specific task group, probably using contextvars.

I believe that this approach would allow more control over tasks implicitly spawned by 3rd-party libraries that cannot control.

How about your thoughts?
History
Date User Action Args
2022-02-24 05:45:56achimnolsetrecipients: + achimnol, gvanrossum, asvetlov, yselivanov
2022-02-24 05:45:56achimnolsetmessageid: <1645681556.47.0.510927748304.issue46844@roundup.psfhosted.org>
2022-02-24 05:45:56achimnollinkissue46844 messages
2022-02-24 05:45:56achimnolcreate