MCPcopy
hub / github.com/psycopg/psycopg / gather

Function gather

tests/acompat.py:62–74  ·  view source on GitHub ↗

Equivalent to asyncio.gather or Thread.join()

(*ts, return_exceptions=False, timeout=None)

Source from the content-addressed store, hash-verified

60
61
62def gather(*ts, return_exceptions=False, timeout=None):
63 """
64 Equivalent to asyncio.gather or Thread.join()
65 """
66 if ts and inspect.isawaitable(ts[0]):
67 rv: Any = asyncio.gather(*ts, return_exceptions=return_exceptions)
68 if timeout is None:
69 rv = asyncio.wait_for(rv, timeout)
70 return rv
71 else:
72 for t in ts:
73 t.join(timeout)
74 assert not t.is_alive()
75
76
77def asleep(s):

Callers 15

test_notifyFunction · 0.70
test_notify_timeoutFunction · 0.70
test_stop_afterFunction · 0.70
test_stop_after_batchFunction · 0.70
test_notifies_blockingFunction · 0.70
test_notify_query_notifyFunction · 0.70
test_copy_concurrencyFunction · 0.70
test_notifyFunction · 0.70
test_notify_timeoutFunction · 0.70
test_stop_afterFunction · 0.70
test_stop_after_batchFunction · 0.70

Calls 1

joinMethod · 0.45

Tested by 15

test_notifyFunction · 0.56
test_notify_timeoutFunction · 0.56
test_stop_afterFunction · 0.56
test_stop_after_batchFunction · 0.56
test_notifies_blockingFunction · 0.56
test_notify_query_notifyFunction · 0.56
test_copy_concurrencyFunction · 0.56
test_notifyFunction · 0.56
test_notify_timeoutFunction · 0.56
test_stop_afterFunction · 0.56
test_stop_after_batchFunction · 0.56