ctp-slack-bot / src /ctp_slack_bot /services /http_client_service.py
LiKenun's picture
Refactor #3
bb7c9a3
raw
history blame contribute delete
411 Bytes
from dependency_injector.resources import AsyncResource
from httpx import AsyncClient
from typing import Self
# TODO: Implement HTTPClientService to abstract away underlying HTTP client.
class HTTPClientServiceResource(AsyncResource):
async def init(self: Self) -> AsyncClient:
return AsyncClient()
async def shutdown(self: Self, client: AsyncClient) -> None:
await client.aclose()