Skip to content

AsyncTransport

Class: warmhub.AsyncTransport

Issues tRPC calls over an httpx.AsyncClient.

trpc_url(path: str)

Documentation is not yet available.

request(path: str, payload: object, *, timeout: httpx.Timeout | Unset = UNSET, headers: Mapping[str, str] | Unset = UNSET, extra_query: Mapping[str, str] | Unset = UNSET)

POST one tRPC call and return the decoded result.data.

assert_compatible(*, headers: Mapping[str, str] | Unset = UNSET, extra_query: Mapping[str, str] | Unset = UNSET)

Documentation is not yet available.

assert_write_compatible()

Documentation is not yet available.

request_json(method: str, path: str, body: object = None, *, timeout: httpx.Timeout | Unset = UNSET, headers: Mapping[str, str] | Unset = UNSET, extra_query: Mapping[str, str] | Unset = UNSET)

Issue one REST call and return its decoded JSON body.

Mirrors requestJson. Shares send with the tRPC path, so the REST surface gets the same auth stamping, the same 401 refresh retry and the same timeout handling — the alternative was a second request path where those three could drift silently.

request_health(*, timeout: httpx.Timeout | Unset = UNSET, headers: Mapping[str, str] | Unset = UNSET, extra_query: Mapping[str, str] | Unset = UNSET)

GET /health. Its own verb because its failure path is its own.

See interpret_health_response. Named rather than expressed as a flag on request_json, because a flag would read as a formatting choice when it is a different question being asked of the response.

send(plan: RequestPlan, *, timeout: httpx.Timeout | Unset = UNSET, headers: Mapping[str, str] | Unset = UNSET, stream: bool = False)

Mirrors fetchWithAuth: stamp auth + identity, retry once on 401.

stream=True returns before the body is read, for the responses whose whole point is not to be buffered — the NDJSON export. The caller owns closing it, and must read the body itself before touching .text.

aclose()

Close the pool if we opened it. An injected transport is left alone.

warn_if_leaked()

Documentation is not yet available.

api_url

Documentation is not yet available.

http

Documentation is not yet available.

owns_http

False when the caller injected the transport.

client_flags

Normalized client_flags, stamped on every request.

is_closed

Documentation is not yet available.