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