Skip to main content

Tasks, Futures & Concurrency

Fine-Grained Control with wait

0:00
LearnStep 1/4

asyncio.wait vs gather

wait: More Control

While gather waits for all tasks, wait gives you more control:

python

gather vs wait

Featuregatherwait
InputCoroutines or TasksTasks only
ReturnsList of results(done, pending) sets
OrderPreserves input orderUnordered sets
ControlAll or nothingFIRST_COMPLETED, etc.