Async Python with asyncio: coroutines, tasks, web requests

10 steps · about 4 h 20 min · Intermediate

  1. AsyncIO in Python (visual walkthrough) (video, YouTube, 30 min)

    Animations show what the event loop does, before you read any code.

  2. A conceptual overview of asyncio (doc, Python docs, 25 min)

    The official mental model of coroutines, tasks and await, from the Python team.

  3. Python's asyncio: A Hands-On Walkthrough (tutorial, Real Python, 40 min)

    Hands-on code for defining coroutines, running them and chaining them.

  4. 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.

  5. Coroutines and tasks (doc, Python docs, 30 min)

    The reference for create_task, TaskGroup, gather and cancellation, which you can now read with context.

  6. Python & aiohttp: Sending multiple requests concurrently (article, Sling Academy, 15 min)

    Your first real concurrent web requests: ClientSession plus gather.

  7. 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.

  8. Asynchronous Request Handling with aiohttp: Best Practices (article, Reintech, 20 min)

    Covers session reuse, connection limits, retries and error handling for real workloads.

  9. 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.

  10. Developing with asyncio (doc, Python docs, 15 min)

    Teaches debug mode and how to catch never-awaited coroutines, the usual first bugs.