Skip to content
UPEEC

asyncio (module)

Event loop, tasks, timeouts, queues and streams for asynchronous I/O.

Intermediate
Comments 0
async with asyncio.timeout(2):          # 3.11+
    data = await reader.read(100)
async with asyncio.TaskGroup() as tg:   # structured concurrency
    tg.create_task(poll_a()); tg.create_task(poll_b())

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.