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

Method _main

asyncpg/_testbase/fuzzer.py:96–110  ·  view source on GitHub ↗
(self, started_event)

Source from the content-addressed store, hash-verified

94 self.loop.close()
95
96 async def _main(self, started_event):
97 self.listen_task = asyncio.ensure_future(self.listen())
98 # Notify the main thread that we are ready to go.
99 started_event.set()
100 try:
101 await self.listen_task
102 finally:
103 tasks = list(self.connections.values())
104 for c in list(self.connections):
105 c.close()
106 await asyncio.gather(*tasks, return_exceptions=True)
107 if hasattr(self.loop, 'remove_reader'):
108 with contextlib.suppress(NotImplementedError):
109 self.loop.remove_reader(self.sock.fileno())
110 self.sock.close()
111
112 async def listen(self):
113 while True:

Callers 1

_start_threadMethod · 0.95

Calls 2

listenMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected