Lines Matching defs:futures
12 import concurrent.futures
26 from . import futures
62 if futures._get_loop(t) is loop and not t.done()}
78 class Task(futures._PyFuture): # Inherit Python Task implementation
124 if self._state == futures._PENDING and self._log_destroy_pending:
290 if futures._get_loop(result) is not self._loop:
348 # instead of `__next__()`, which is slower for futures
384 FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
385 FIRST_EXCEPTION = concurrent.futures.FIRST_EXCEPTION
386 ALL_COMPLETED = concurrent.futures.ALL_COMPLETED
405 if futures.isfuture(fs) or coroutines.iscoroutine(fs):
406 raise TypeError(f"expect a list of futures, not {type(fs).__name__}")
574 Note: The futures 'f' are not necessarily members of fs.
576 if futures.isfuture(fs) or coroutines.iscoroutine(fs):
577 raise TypeError(f"expect an iterable of futures, not {type(fs).__name__}")
636 futures._set_result_unless_cancelled,
653 if futures.isfuture(coro_or_future):
654 if loop is not None and loop is not futures._get_loop(coro_or_future):
689 class _GatheringFuture(futures.Future):
719 """Return a future aggregating results from the given coroutines/futures.
725 All futures must share the same event loop. If all the tasks are
779 # All futures are done; create a list of results
819 loop = futures._get_loop(fut)
878 loop = futures._get_loop(inner)
910 Return a concurrent.futures.Future to access the result.
914 future = concurrent.futures.Future()
918 futures._chain_future(ensure_future(coro, loop=loop), future)