Pool.collect_any_async()
The event-driven collect_any():
Usage
Pool.collect_any_async(tasks)exactly one asyncio.Future per collection — never one per task — driven by the enrolled tasks’ notify announces.
Parameters
tasks: _Iterable[Task]-
The
Taskhandles to wait on.
Returns
Anasyncio.Futureresolving with the first terminal task’s-
(index, value)(the sync verb’s tie-breaks); a non-OK outcome rejects with the exception the sync verb raises (indexattribute carried). There is notimeoutargument:asyncio.timeout/asyncio.wait_forare the idiom. Cancelling the Future un-enrolls every task — each returns to blocking-collectible — and never cancels them.