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

Method _read

asyncpg/_testbase/fuzzer.py:212–232  ·  view source on GitHub ↗
(self, sock, n)

Source from the content-addressed store, hash-verified

210 self.backend_sock.close()
211
212 async def _read(self, sock, n):
213 read_task = asyncio.ensure_future(
214 self.loop.sock_recv(sock, n))
215 conn_event_task = asyncio.ensure_future(
216 self.connectivity_loss.wait())
217
218 try:
219 await asyncio.wait(
220 [read_task, conn_event_task],
221 return_when=asyncio.FIRST_COMPLETED)
222
223 if self.connectivity_loss.is_set():
224 return None
225 else:
226 return read_task.result()
227 finally:
228 if not self.loop.is_closed():
229 if not read_task.done():
230 read_task.cancel()
231 if not conn_event_task.done():
232 conn_event_task.cancel()
233
234 async def _write(self, sock, data):
235 write_task = asyncio.ensure_future(

Callers 2

proxy_to_backendMethod · 0.95
proxy_from_backendMethod · 0.95

Calls 1

is_closedMethod · 0.80

Tested by

no test coverage detected