Skip to main content
Loading page…
Python Mastery
Chapter 37
Lesson 1 of 4
The Event Loop, Tasks & Gathering
Contents
Notes
Tutor
Note
Building on the Concurrency Module
Loading activity…
Previous
1 / 10
Continue
Contents
Notes
Discussion
Tutor
28 min
10 activities
0 of 10 done
In this lesson
1
Building on the Concurrency Module
2
The Mental Model: One Thread, Many Pauses
3
create_task vs await: Seeing Concurrency
4
asyncio.gather, wait_for, and TaskGroup
5
Task Cancellation & Cleanup
6
The #1 Asyncio Mistake: Forgetting to await
7
gather vs sequential await
8
Race the Tasks
9
TaskGroup Parallel Counter
10
Explain CancelledError Re-raise
Objectives
Learner can explain how the event loop drives coroutines without threads
Learner can distinguish coroutine objects from Task objects and know when to use each
Learner can run coroutines concurrently with asyncio.gather and asyncio.TaskGroup
Learner can impose deadlines with asyncio.wait_for and cancel tasks programmatically
Learner can identify and fix the most common async/await mistakes
Chapter 37 · Asyncio Deep Dive & Concurrency Patterns
The Event Loop, Tasks & Gathering
Async Synchronization & Queues
Threads, Processes & Executors
Real Async I/O
Previous: Multiprocessing for CPU Work
Next: Async Synchronization & Queues