liveBook · Manning

Asyncio

asyncio is Python’s standard-library framework for asynchronous programming, built around coroutines, awaitable objects, and event loops.

How 2 Manning books explain it

Python Concurrency with asyncio

A Python library for asynchronous programming that executes coroutines using concurrency mechanisms such as an event loop.

How it is used
Handles concurrent I/O workloads such as web requests, database queries, sockets, microservices, and background event processing.
How deep it goes
Explains async syntax, coroutines, tasks, cancellation, event loops, non-blocking sockets, pools, queues, and custom loop implementation.
Examples
Uses delay tasks, status reporting, echo servers, database batch queries, task runners, process pools, and producer-consumer queues.
What you can do after
Build and operate responsive I/O applications with async, await, asyncio.run, tasks, cancellation, queues, and event-loop APIs.

Read how Python Concurrency with asyncio explains asyncio →

Building LLM Applications with DSPy

asyncio is Python’s standard library for writing concurrent code using the async and await syntax.

How it is used
Supports concurrent DSPy program or submodule execution when LM applications spend time waiting on remote work.
How deep it goes
Explains coroutines, async/await, and event-loop task management, then demonstrates concurrent waits without detailing scheduler internals.
Examples
Uses LM requests as motivation and demonstrates two sleep-based coroutines coordinated with asyncio.gather.
What you can do after
Apply it via Python’s asyncio library to coordinate waiting coroutines with async/await, an event loop, and asyncio.gather.

Read how Building LLM Applications with DSPy explains asyncio →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.