collect_any()
Wait on several tasks.
Usage
collect_any(
tasks,
timeout=None,
)Parameters
tasks: _Iterable[Task]-
The
Taskhandles to wait on. timeout: float | None = None- Seconds to wait; None waits indefinitely.
Returns
(index, value)of the first task to finish, or the-
TIMEOUTsentinel. A failure raises with anindexattribute (0-based).
Raises
ConcurrentUseError- Another wait-half verb (a blocking collect, stop()) is in flight on this handle from a second thread: the waiting half is confined to one thread (the class docstring).