A way to collect results upon exiting task group
See original GitHub issueIn asyncio
, there’s await asyncio.gather(..a..lot..of..tasks)
.
Is it possible to somehow emulate this with anyio
?
I’m thinking of something like this maybe:
async with create_task_group() as tg:
await tg.spawn(t1)
await tg.spawn(t2)
print(tg.results) # t1_res, t2_res
Issue Analytics
- State:
- Created 4 years ago
- Comments:26 (6 by maintainers)
Top Results From Across the Web
Understanding Swift Task Groups With Example - Swift Senpai
A task group can exit by either returning a value, returning void (non-value-returning), or throwing an error. Now that you have learned how...
Read more >Task groups in Azure Pipelines and TFS (classic)
A task group allows you to encapsulate a sequence of tasks, already defined in a build or a release pipeline, into a single...
Read more >Accept the first Task to complete - Using Swift - Swift Forums
I've been searching without luck for a method or pattern to accept the first member of a TaskGroup (or some other collection of...
Read more >How to create a task group and add tasks to it
Swift's task groups are collections of tasks that work together to produce a single result. Each task inside the group must return the...
Read more >Running tasks in parallel with Swift Concurrency's task groups
As we iterate over the group's results, a failed task also counts as a result. However, when the group's next() function is called...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s well within your rights to wontfix this, but I will chip in my $0.02 and say when I found out anyio/trio don’t have good
gather
ergonomics my interest waned pretty significantly. In other words, I findgather
in asyncio very, very good. Which is a little unfortunate because anyio/trio cancellation scopes are so awesome.