28 """Abstract base class for stop strategies."""
31 def __call__(self, retry_state:
"RetryCallState") -> bool:
34 def __and__(self, other:
"stop_base") ->
"stop_all":
37 def __or__(self, other:
"stop_base") ->
"stop_any":
45 """Stop if any of the stop condition is valid."""
50 def __call__(self, retry_state:
"RetryCallState") -> bool:
51 return any(x(retry_state)
for x
in self.
stops)
55 """Stop if all the stop conditions are valid."""
60 def __call__(self, retry_state:
"RetryCallState") -> bool:
61 return all(x(retry_state)
for x
in self.
stops)
67 def __call__(self, retry_state:
"RetryCallState") -> bool:
75 """Stop when the given event is set."""
77 def __init__(self, event:
"threading.Event") ->
None:
80 def __call__(self, retry_state:
"RetryCallState") -> bool:
85 """Stop when the previous attempt >= max_attempt."""
87 def __init__(self, max_attempt_number: int) ->
None:
90 def __call__(self, retry_state:
"RetryCallState") -> bool:
95 """Stop when the time from the first attempt >= limit."""
97 def __init__(self, max_delay: _utils.time_unit_type) ->
None:
100 def __call__(self, retry_state:
"RetryCallState") -> bool:
102 raise RuntimeError(
"__call__() called but seconds_since_start is not set")
bool __call__(self, "RetryCallState" retry_state)
bool __call__(self, "RetryCallState" retry_state)
None __init__(self, int max_attempt_number)
bool __call__(self, "RetryCallState" retry_state)
None __init__(self, _utils.time_unit_type max_delay)
bool __call__(self, "RetryCallState" retry_state)
None __init__(self, *stop_base stops)
bool __call__(self, "RetryCallState" retry_state)
None __init__(self, *stop_base stops)
bool __call__(self, "RetryCallState" retry_state)
"stop_all" __and__(self, "stop_base" other)
"stop_any" __or__(self, "stop_base" other)
bool __call__(self, "RetryCallState" retry_state)
None __init__(self, "threading.Event" event)