INNER CODE UNIT · Python
_lifespan
RekklesNA/ProxmoxMCP-Plus · src/proxmox_mcp/server.py:239
async def _lifespan(self, _mcp: Any) -> AsyncIterator[dict[str, Any]]:
# HTTP SDK lifespans run per client session. Own its pool around the
# HTTP server instead, so disconnecting one client cannot close others.
if self.config.mcp.transport == "STDIO":
async with self._code_mode_lifespan():
yield {}
else:
yield {}
@asynccontextmanager
async def _code_mode_lifespan(self) -> AsyncIterator[None]:
if self.code_mode is not None and self.config.mcp.code_mode_pool_reuse:
async with self.code_mode.pool_lifespan():
yield
else:
yield
def _build_transport_security(self) -> Any | None: