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

Function gather

psycopg_pool/psycopg_pool/_acompat.py:143–157  ·  view source on GitHub ↗

Equivalent to asyncio.gather or Thread.join()

(
    *tasks: threading.Thread, timeout: float | None = None, timeout_hint: str = ""
)

Source from the content-addressed store, hash-verified

141
142
143def gather(
144 *tasks: threading.Thread, timeout: float | None = None, timeout_hint: str = ""
145) -> None:
146 """
147 Equivalent to asyncio.gather or Thread.join()
148 """
149 for t in tasks:
150 if not t.is_alive():
151 continue
152 t.join(timeout)
153 if not t.is_alive():
154 continue
155 logger.warning("couldn't stop thread %r within %s seconds", t.name, timeout)
156 if timeout_hint:
157 logger.warning("hint: %s", timeout_hint)
158
159
160def asleep(seconds: float) -> Coroutine[Any, Any, None]:

Callers 2

__del__Method · 0.70
closeMethod · 0.70

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected