Skip to main content

← All terms Β· Async & concurrency

async def

Declares a coroutine. Can be awaited; runs cooperatively on an event loop.

Learn this interactively:

Open lesson sr-21 β†’

Related β€” Async & concurrency

awaitPauses a coroutine until another coroutine/Future finishes. Only legal inside `a…Event loopScheduler that drives async code β€” runs ready coroutines, parks blocked ones. `a…GILGlobal Interpreter Lock β€” CPython's mutex that lets only one thread run Python b…asyncio.gatherRun multiple coroutines concurrently and wait for all of them. The bread-and-but…