4 ms·
async with asyncio.TaskGroup() as g: g.create_task(concurrent_task1()) g.create_task(concurrent_task1()) reminds me of the structural concurrency: a
by d0mine 5y ago
async with asyncio.TaskGroup() as g:
g.create_task(concurrent_task1())
g.create_task(concurrent_task1())
reminds me of the structural concurrency:
async with trio.open_nursery() as nursery:
nursery.start_soon(myfunc)
nursery.start_soon(anotherfunc)
> nurseries ... rather a new control flow primitive that's just as fundamental as for loops or function calls
https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/ https://vorpus.org/blog/notes-on-structured-concurrency-or-g...
> Implementing a better task spawning API in asyncio, inspired by Trio nurseries, was the main motivation for this PEP
https://www.python.org/dev/peps/pep-0654/#motivation https://www.python.org/dev/peps/pep-0654/#motivation
- BiteCode_dev 5y agoIt is explicitly inspired by it.
- meowface 5y agoIndeed, the screenshot at the bottom with that syntax says "inspired by Trio".