MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _wait

Method _wait

asyncpg/_testbase/fuzzer.py:38–55  ·  view source on GitHub ↗
(self, work)

Source from the content-addressed store, hash-verified

36 self.listen_task = None
37
38 async def _wait(self, work):
39 work_task = asyncio.ensure_future(work)
40 stop_event_task = asyncio.ensure_future(self.stop_event.wait())
41
42 try:
43 await asyncio.wait(
44 [work_task, stop_event_task],
45 return_when=asyncio.FIRST_COMPLETED)
46
47 if self.stop_event.is_set():
48 raise StopServer()
49 else:
50 return work_task.result()
51 finally:
52 if not work_task.done():
53 work_task.cancel()
54 if not stop_event_task.done():
55 stop_event_task.cancel()
56
57 def start(self):
58 started = threading.Event()

Callers 1

listenMethod · 0.95

Calls 1

StopServerClass · 0.85

Tested by

no test coverage detected