Async Python with asyncio: coroutines, tasks, web requests
10 steps · about 4 h 20 min · Intermediate
- AsyncIO in Python (visual walkthrough) (video, YouTube, 30 min)
Animations show what the event loop does, before you read any code.
- A conceptual overview of asyncio (doc, Python docs, 25 min)
The official mental model of coroutines, tasks and await, from the Python team.
- Python's asyncio: A Hands-On Walkthrough (tutorial, Real Python, 40 min)
Hands-on code for defining coroutines, running them and chaining them.
- Python Async Programming: A Deep Dive into async/await and the Event Loop (article, Alex Jacobs, 25 min)
Goes deeper on how Tasks wrap coroutines and how the event loop schedules them.
- Coroutines and tasks (doc, Python docs, 30 min)
The reference for create_task, TaskGroup, gather and cancellation, which you can now read with context.
- Python & aiohttp: Sending multiple requests concurrently (article, Sling Academy, 15 min)
Your first real concurrent web requests: ClientSession plus gather.
- How to Use Python's asyncio for Concurrent HTTP Requests? (article, C# Corner, 15 min)
Explains why blocking requests breaks asyncio, and adds semaphores and timeouts.
- Asynchronous Request Handling with aiohttp: Best Practices (article, Reintech, 20 min)
Covers session reuse, connection limits, retries and error handling for real workloads.
- asyncio tutorial (aiohttp and aiofiles) (repo, GitHub, Hackers and Slackers, 45 min)
Clone it and run a working project that fetches many URLs and writes the results to disk.
- Developing with asyncio (doc, Python docs, 15 min)
Teaches debug mode and how to catch never-awaited coroutines, the usual first bugs.