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

Method _acquire_impl

asyncpg/pool.py:878–889  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

876
877 async def _acquire(self, timeout):
878 async def _acquire_impl():
879 ch = await self._queue.get() # type: PoolConnectionHolder
880 try:
881 proxy = await ch.acquire() # type: PoolConnectionProxy
882 except (Exception, asyncio.CancelledError):
883 self._queue.put_nowait(ch)
884 raise
885 else:
886 # Record the timeout, as we will apply it by default
887 # in release().
888 ch._timeout = timeout
889 return proxy
890
891 if self._closing:
892 raise exceptions.InterfaceError('pool is closing')

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
acquireMethod · 0.45

Tested by

no test coverage detected