asyncx.wait_any
- async asyncx.wait_any(*awaitables)[source]
Creates a coroutine that waits for any of given awaitables to be completed.
Example
>>> coro1 = asyncio.create_task(asyncio.sleep(1)) >>> coro2 = asyncio.create_task(asyncio.sleep(2)) >>> await asyncx.wait_any(coro1, coro2) is coro1 True
- Parameters
awaitables (Awaitable[Any]) – Awaitable objects to wait.
- Returns
A
Coroutineobject that returns first finishedasyncio.Futureobject.- Return type
Awaitable[Any]