Lines Matching refs:loop
35 def current_task(loop=None): argument
37 if loop is None:
38 loop = events.get_running_loop()
39 return _current_tasks.get(loop)
42 def all_tasks(loop=None): argument
44 if loop is None:
45 loop = events.get_running_loop()
62 if futures._get_loop(t) is loop and not t.done()}
93 def __init__(self, coro, *, loop=None, name=None): argument
94 super().__init__(loop=loop)
336 loop = events.get_running_loop()
337 task = loop.create_task(coro)
372 loop = events.get_running_loop()
382 fs = {ensure_future(f, loop=loop) for f in fs}
384 return await _wait(fs, timeout, return_when, loop)
405 loop = events.get_running_loop()
411 fut = ensure_future(fut, loop=loop)
416 await _cancel_and_wait(fut, loop=loop)
422 waiter = loop.create_future()
423 timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
426 fut = ensure_future(fut, loop=loop)
441 await _cancel_and_wait(fut, loop=loop)
451 await _cancel_and_wait(fut, loop=loop)
463 async def _wait(fs, timeout, return_when, loop): argument
469 waiter = loop.create_future()
472 timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
507 async def _cancel_and_wait(fut, loop): argument
510 waiter = loop.create_future()
548 loop = events._get_event_loop()
549 todo = {ensure_future(f, loop=loop) for f in set(fs)}
576 timeout_handle = loop.call_later(timeout, _on_timeout)
599 loop = events.get_running_loop()
600 future = loop.create_future()
601 h = loop.call_later(delay,
610 def ensure_future(coro_or_future, *, loop=None): argument
615 return _ensure_future(coro_or_future, loop=loop)
618 def _ensure_future(coro_or_future, *, loop=None): argument
620 if loop is not None and loop is not futures._get_loop(coro_or_future):
633 if loop is None:
634 loop = events._get_event_loop(stacklevel=4)
636 return loop.create_task(coro_or_future)
663 def __init__(self, children, *, loop): argument
664 assert loop is not None
665 super().__init__(loop=loop)
715 loop = events._get_event_loop()
716 outer = loop.create_future()
779 loop = None
783 fut = _ensure_future(arg, loop=loop)
784 if loop is None:
785 loop = futures._get_loop(fut)
803 outer = _GatheringFuture(children, loop=loop)
837 loop = futures._get_loop(inner)
838 outer = loop.create_future()
866 def run_coroutine_threadsafe(coro, loop): argument
877 futures._chain_future(ensure_future(coro, loop=loop), future)
885 loop.call_soon_threadsafe(callback)
902 def _enter_task(loop, task): argument
903 current_task = _current_tasks.get(loop)
907 _current_tasks[loop] = task
910 def _leave_task(loop, task): argument
911 current_task = _current_tasks.get(loop)
915 del _current_tasks[loop]