MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / acquire

Method acquire

tests/fixtures/sample.py:83–89  ·  view source on GitHub ↗

Acquire a connection from the pool.

(self)

Source from the content-addressed store, hash-verified

81 self._connections: List[Connection] = []
82
83 async def acquire(self) -> Optional[Connection]:
84 """Acquire a connection from the pool."""
85 if self._connections:
86 return self._connections.pop()
87 conn = Connection(self._name)
88 await conn.connect()
89 return conn
90
91 def release(self, conn: Connection) -> None:
92 self._connections.append(conn)

Callers

nothing calls this directly

Calls 2

connectMethod · 0.95
ConnectionClass · 0.70

Tested by

no test coverage detected