Python 3.11: A Guided Tour Through Code Transcripts
Chapter: Concurrency Improvements
Lecture: TaskGroup Introduction
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
If you're doing async work that involves more than one task and a lot of async work does imagine
0:09
I want to log something to a file and put it into the cache or I want to get something from the database and call an API.
0:17
At the same time. Well you're working with a group of tasks and Python 3.11 now has task groups
0:24
specifically for that and this github issue as far as I can tell is the definitive source of this information
0:31
I couldn't find a PEP for it. Maybe I just missed it. I always thought perhaps for what we needed to make changes to the language,
0:38
but it looks like this github issue by none other than jGuido Van Rossum himself is the definitive source of this
0:45
information. Nonetheless, it's a really cool feature that allows us to start a bunch of tasks,
0:51
wait for them all to finish if there's an error or we want to stop part way through cancel the ones
0:57
that have not run a bunch of great features like that.