Name and Version
latest
What is the problem this feature will solve?
Dial, AsyncDial, DialClientPool, and AsyncDialClientPool should expose public lifecycle APIs for closing underlying HTTP clients.
What is the feature you are proposing to solve the problem?
Motivation
AsyncDial owns an internal httpx.AsyncClient, but there is no public aclose() or async context manager. Consumers currently need to close internals manually:
await dial._http_client.internal_http_client.aclose()
For pooled clients, AsyncDialClientPool also owns a shared httpx.AsyncClient, but does not expose aclose(), __aenter__, or __aexit__.
Proposed API
For sync clients and pools:
client.close()
with Dial(...) as client:
...
For async clients and pools:
await client.aclose()
async with AsyncDial(...) as client:
...
For pools:
pool.close()
await async_pool.aclose()
Use Case
Framework applications need deterministic shutdown without relying on private attributes or injecting and managing their own httpx client.
What alternatives have you considered?
No response
Name and Version
latest
What is the problem this feature will solve?
Dial,AsyncDial,DialClientPool, andAsyncDialClientPoolshould expose public lifecycle APIs for closing underlying HTTP clients.What is the feature you are proposing to solve the problem?
Motivation
AsyncDialowns an internalhttpx.AsyncClient, but there is no publicaclose()or async context manager. Consumers currently need to close internals manually:For pooled clients,
AsyncDialClientPoolalso owns a sharedhttpx.AsyncClient, but does not exposeaclose(),__aenter__, or__aexit__.Proposed API
For sync clients and pools:
For async clients and pools:
For pools:
Use Case
Framework applications need deterministic shutdown without relying on private attributes or injecting and managing their own
httpxclient.What alternatives have you considered?
No response