Asyncio, tasks, and exception handling - recommended idioms?

Sorry we didn’t get more time at the conference! I hope you nevertheless had a good time.

I agree that as_completed is not an API we want to promote; you can do what it does by registering “done callbacks” for the tasks.

While I appreciate the table, I’d like to see a more detailed comparison between PersistentTaskGroup and Supervisor. AFAIK the former is just like TaskGroup but doesn’t cancel siblings when a task exits with an exception or is cancelled. This can be done by adding a new keyword argument to TaskGroup. How is Supervisor different?

1 Like