MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / connect

Method connect

asyncpg/pool.py:147–156  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 return not self._in_use
146
147 async def connect(self) -> None:
148 if self._con is not None:
149 raise exceptions.InternalClientError(
150 'PoolConnectionHolder.connect() called while another '
151 'connection already exists')
152
153 self._con = await self._pool._get_new_connection()
154 self._generation = self._pool._generation
155 self._maybe_cancel_inactive_callback()
156 self._setup_inactive_callback()
157
158 async def acquire(self) -> PoolConnectionProxy:
159 if self._con is None or self._con.is_closed():

Callers 2

acquireMethod · 0.95
_initializeMethod · 0.95

Tested by

no test coverage detected