|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | | -from typing import TYPE_CHECKING |
4 | | - |
5 | 3 | from kombu.asynchronous import get_event_loop |
6 | | -from kombu.asynchronous.http.base import Headers, Request, Response |
| 4 | +from kombu.asynchronous.http.base import BaseClient, Headers, Request, Response |
7 | 5 | from kombu.asynchronous.hub import Hub |
8 | 6 |
|
9 | | -if TYPE_CHECKING: |
10 | | - from kombu.asynchronous.http.curl import CurlClient |
11 | | - |
12 | | -__all__ = ('Client', 'Headers', 'Response', 'Request') |
| 7 | +__all__ = ('Client', 'Headers', 'Response', 'Request', 'get_client') |
13 | 8 |
|
14 | 9 |
|
15 | | -def Client(hub: Hub | None = None, **kwargs: int) -> CurlClient: |
| 10 | +def Client(hub: Hub | None = None, **kwargs: int) -> BaseClient: |
16 | 11 | """Create new HTTP client.""" |
17 | | - from .curl import CurlClient |
18 | | - return CurlClient(hub, **kwargs) |
| 12 | + from .urllib3_client import Urllib3Client |
| 13 | + return Urllib3Client(hub, **kwargs) |
19 | 14 |
|
20 | 15 |
|
21 | | -def get_client(hub: Hub | None = None, **kwargs: int) -> CurlClient: |
| 16 | +def get_client(hub: Hub | None = None, **kwargs: int) -> BaseClient: |
22 | 17 | """Get or create HTTP client bound to the current event loop.""" |
23 | 18 | hub = hub or get_event_loop() |
24 | 19 | try: |
|
0 commit comments