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

Method _acquire_impl

asyncpg/pool.py:995–1007  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

993
994 async def _acquire(self, timeout):
995 async def _acquire_impl():
996 ch = await self._queue.get() # type: PoolConnectionHolder
997 try:
998 proxy = await ch.acquire() # type: PoolConnectionProxy
999 except (Exception, asyncio.CancelledError):
1000 self._queue.put_nowait(ch)
1001 self._schedule_min_size_maintenance()
1002 raise
1003 else:
1004 # Record the timeout, as we will apply it by default
1005 # in release().
1006 ch._timeout = timeout
1007 return proxy
1008
1009 if self._closing:
1010 raise exceptions.InterfaceError('pool is closing')

Callers

nothing calls this directly

Calls 3

getMethod · 0.80
acquireMethod · 0.45

Tested by

no test coverage detected