Open
Description
asyncio could really use a TaskGroup
implementation, as provided by Trio (aka nurseries), Curio, aiotools, and EdgeDB.
TaskGroup
was originally slated to be added Python as long ago as 3.8, but was held up because exception group handling was not available. However, exception groups are now being added: PEP 654, PR). Once that PEP is implemented, TaskGroup
will probably follow. But the timeline for PEP 654 to go into the MicroPython core is unclear. So any TaskGroup we add will not be quite compatible, and we probably want to add it in an ancillary library (adafruit_asyncio
or asynciox
or xasyncio
or ??).
Metadata
Metadata
Assignees
Labels
No labels
Activity
dhalbert commentedon Feb 16, 2022
TaskGroups going in to CPython 3.11:
https://bugs.python.org/issue46752
python/cpython#31270
Quattro version (not using multi-except):
https://github.com/Tinche/quattro
dorinclisu commentedon Apr 14, 2024
I agree it would be a good idea to support structured concurrency, as going head-on with the older asyncio primitives can get pretty messy.
Maybe the anyio lib could be helpful, as it follows the good ideas of trio but can work with the default asyncio backend.