-
Notifications
You must be signed in to change notification settings - Fork 854
Expand file tree
/
Copy path__init__.py
More file actions
52 lines (44 loc) · 1.37 KB
/
__init__.py
File metadata and controls
52 lines (44 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from typing import List
from .handler import RetryHandler
from .builtin_handlers import (
ConnectionErrorRetryHandler,
RateLimitErrorRetryHandler,
ServerErrorRetryHandler,
)
from .interval_calculator import RetryIntervalCalculator
from .builtin_interval_calculators import (
FixedValueRetryIntervalCalculator,
BackoffRetryIntervalCalculator,
)
from .jitter import Jitter
from .request import HttpRequest
from .response import HttpResponse
from .state import RetryState
connect_error_retry_handler = ConnectionErrorRetryHandler()
rate_limit_error_retry_handler = RateLimitErrorRetryHandler()
server_error_retry_handler = ServerErrorRetryHandler()
def default_retry_handlers() -> List[RetryHandler]:
return [connect_error_retry_handler]
def all_builtin_retry_handlers() -> List[RetryHandler]:
return [
connect_error_retry_handler,
rate_limit_error_retry_handler,
server_error_retry_handler,
]
__all__ = [
"RetryHandler",
"ConnectionErrorRetryHandler",
"RateLimitErrorRetryHandler",
"ServerErrorRetryHandler",
"RetryIntervalCalculator",
"FixedValueRetryIntervalCalculator",
"BackoffRetryIntervalCalculator",
"Jitter",
"HttpRequest",
"HttpResponse",
"RetryState",
"connect_error_retry_handler",
"rate_limit_error_retry_handler",
"default_retry_handlers",
"all_builtin_retry_handlers",
]