Loading topic
try/except works and what generators and iterators are. Basic familiarity with the difference between I/O-bound and CPU-bound work helps, and the next section reviews it.2 min readasync def and await syntax, and that you can tell I/O-bound work from CPU-bound work. Here you will see how one thread runs many coroutines.3 min readasync def and await, and that you know what an event loop is.2 min readasync def and await, and start a program with asyncio.run. It also assumes you know the event loop runs one piece of work at a time and switches only at await points.2 min readasync def and await, start them with asyncio.run, and wrap them in tasks with asyncio.create_task. It also assumes you know basic try/except.2 min readasync def and await, start a program with asyncio.run, and create tasks with asyncio.create_task. It also assumes you know try/except and context managers.2 min readasyncio.run, and run them together with gather or a TaskGroup. It also assumes you know try/except. Here you will see how an exception in one task affects its siblings, and how to handle it.2 min readasyncio.create_task, and that you know try/except/finally and how await suspends a coroutine.2 min readCancelledError inside it. The examples need Python 3.11 or later.2 min readasyncio.create_task, and collect results with asyncio.gather. It covers the synchronization primitives that limit how many tasks run at once and let tasks wait for each other.2 min readasyncio.create_task, and use Semaphore to limit concurrency. You should also know what a context switch at await means.2 min readasyncio.run, and run them together with gather. It also assumes you know the difference between I/O-bound and CPU-bound work.2 min readasync def and await. It shows how those three features work when the code needs to await in the middle of them.2 min readasync def and await, start them with asyncio.run, and use async with. Streams are the high-level asyncio API for TCP connections. They let you read and write bytes with await and without callbacks.2 min readgather or TaskGroup. It covers the mistakes that cause most asyncio bugs and the tools that expose them.2 min read