Asynchronous I/O Articles

asyncio — Asynchronous I/O

asyncio is a library to write concurrent code using the async/await syntax.

Coroutines and Tasks

This section outlines high-level asyncio APIs to work with coroutines and Tasks.

Developing with asyncio

Asynchronous programming is different from classic “sequential” programming.

Event Loop

Source code: Lib/asyncio/events.py, Lib/asyncio/base_events.py

Exceptions

Source code: Lib/asyncio/exceptions.py

Futures

Source code: Lib/asyncio/futures.py, Lib/asyncio/base_futures.py

High-level API Index

This page lists all high-level async/await enabled asyncio APIs.

Low-level API Index

This page lists all low-level asyncio APIs.

Platform Support

The asyncio module is designed to be portable, but some platforms have subtle differences and limitations due to the platforms’ underlying architecture and capabilities.

Policies

An event loop policy is a global per-process object that controls the management of the event loop. Each event loop has a default policy, which can be changed and customized using the policy API.

Queues

Source code: Lib/asyncio/queues.py

Streams

Source code: Lib/asyncio/streams.py

Subprocesses

Source code: Lib/asyncio/subprocess.py, Lib/asyncio/base_subprocess.py

Synchronization Primitives

Source code: Lib/asyncio/locks.py

Transports and Protocols

Transports and Protocols are used by the low-level event loop APIs such as loop.create_connection(). They use callback-based programming style and enable high-performance implementations of network or IPC protocols (e.g. HTTP).