Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http2 #86

Merged
merged 8 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions async_firebase/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __init__(
*,
request_timeout: RequestTimeout = DEFAULT_REQUEST_TIMEOUT,
request_limits: RequestLimits = DEFAULT_REQUEST_LIMITS,
use_http2: bool = False,
) -> None:
"""
:param credentials: instance of ``google.oauth2.service_account.Credentials``.
Expand All @@ -66,12 +67,14 @@ def __init__(
:param scopes: user-defined scopes to request during the authorization grant.
:param request_timeout: advanced feature that allows to change request timeout.
:param request_limits: advanced feature that allows to control the connection pool size.
:param use_http2: advanced feature that allows to control usage of http protocol.
"""
self._credentials: service_account.Credentials = credentials
self.scopes: t.List[str] = scopes or self.SCOPES

self._request_timeout = request_timeout
self._request_limits = request_limits
self._use_http2 = use_http2
self._http_client: t.Optional[httpx.AsyncClient] = None

@property
Expand All @@ -80,6 +83,7 @@ def _client(self) -> httpx.AsyncClient:
self._http_client = httpx.AsyncClient(
timeout=httpx.Timeout(**self._request_timeout.__dict__),
limits=httpx.Limits(**self._request_limits.__dict__),
http2=self._use_http2,
)
return self._http_client

Expand Down
Loading
Loading