· advanced
Async Python
When a program spends its time waiting rather than computing, async lets it wait for many things at once. Coroutines, the event loop, running work concurrently, and the mistakes that quietly make it sequential again.
Written in house, from the work rather than from a syllabus. Every example is one we would use ourselves, and every exercise is checked against the same engine that grades your answer.
What you’ll learn
- Tell work that waits from work that computes, and know which async helps
- Write a coroutine with async def and await another one
- Run many coroutines concurrently with gather or a task group
- Cancel work and apply a timeout without leaving tasks behind
- Spot a blocking call that stalls the entire event loop
- Limit how many things run at once with a semaphore
Before you start
- · Comfortable with functions, exceptions and generators
- · Some experience calling something slow, such as an HTTP API