Lines Matching refs:loop
34 def current_task(loop=None): argument
36 if loop is None:
37 loop = events.get_running_loop()
38 return _current_tasks.get(loop)
41 def all_tasks(loop=None): argument
43 if loop is None:
44 loop = events.get_running_loop()
61 if futures._get_loop(t) is loop and not t.done()}
92 def __init__(self, coro, *, loop=None, name=None): argument
93 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):
632 if loop is None:
633 loop = events._get_event_loop(stacklevel=4)
634 return loop.create_task(coro_or_future)
657 def __init__(self, children, *, loop): argument
658 assert loop is not None
659 super().__init__(loop=loop)
709 loop = events._get_event_loop()
710 outer = loop.create_future()
773 loop = None
776 fut = _ensure_future(arg, loop=loop)
777 if loop is None:
778 loop = futures._get_loop(fut)
796 outer = _GatheringFuture(children, loop=loop)
830 loop = futures._get_loop(inner)
831 outer = loop.create_future()
859 def run_coroutine_threadsafe(coro, loop): argument
870 futures._chain_future(ensure_future(coro, loop=loop), future)
878 loop.call_soon_threadsafe(callback)
895 def _enter_task(loop, task): argument
896 current_task = _current_tasks.get(loop)
900 _current_tasks[loop] = task
903 def _leave_task(loop, task): argument
904 current_task = _current_tasks.get(loop)
908 del _current_tasks[loop]