MCPcopy Create free account
hub / github.com/Roy3838/Observer / get_http_client

Function get_http_client

api/api_handlers.py:20–24  ·  view source on GitHub ↗

Return the shared HTTP client. Requires startup_handlers() to have run.

()

Source from the content-addressed store, hash-verified

18_shared_http_client: Optional[httpx.AsyncClient] = None
19
20def get_http_client() -> httpx.AsyncClient:
21 """Return the shared HTTP client. Requires startup_handlers() to have run."""
22 if _shared_http_client is None:
23 raise RuntimeError("Shared HTTP client not initialized.")
24 return _shared_http_client
25
26async def startup_handlers():
27 """Initialize shared resources. Called from FastAPI lifespan on startup."""

Callers 8

handle_requestMethod · 0.90
handle_requestMethod · 0.90
_stream_responseMethod · 0.90
handle_requestMethod · 0.90
handle_requestMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected