MCPcopy Index your code
hub / github.com/python/cpython / run_until

Function run_until

Lib/test/test_asyncio/utils.py:98–106  ·  view source on GitHub ↗
(loop, pred, timeout=support.SHORT_TIMEOUT)

Source from the content-addressed store, hash-verified

96
97
98def run_until(loop, pred, timeout=support.SHORT_TIMEOUT):
99 delay = 0.001
100 for _ in support.busy_retry(timeout, error=False):
101 if pred():
102 break
103 loop.run_until_complete(tasks.sleep(delay))
104 delay = max(delay * 2, 1.0)
105 else:
106 raise TimeoutError()
107
108
109def run_once(loop):

Callers

nothing calls this directly

Calls 3

TimeoutErrorClass · 0.85
run_until_completeMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…