You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-99Lines changed: 5 additions & 99 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,106 +23,12 @@ In practice, only a few knobs are needed (repeatedly!), though.
23
23
- Easy _global_ deactivation for testing.
24
24
25
25
26
-
## Usage
26
+
## Project Information
27
27
28
-
The API consists mainly of the `stamina.retry()` decorator for retrying functions and methods, and the `stamina.retry_context()` iterator / context manager combo for retrying arbitrary code blocks:
Both `retry()` and `retry_context()` take the following arguments (unless stated otherwise, **all time-based arguments are floats of seconds or [`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta)s**):
83
-
84
-
**on**: An Exception or a tuple of Exceptions on which the decorated callable will be retried.
85
-
There is no default – you _must_ pass this explicitly.
86
-
87
-
**attempts**: Maximum number of attempts (default: `10`).
88
-
89
-
**timeout**: Maximum time for all retries.
90
-
Can be combined with *attempts* (default: `45`).
91
-
92
-
**wait_initial**: Minimum first backoff before first retry (default: `0.1`).
93
-
94
-
**wait_max**: Maximum backoff time between retries (default: `5`).
95
-
96
-
**wait_jitter**: Maximum _jitter_ that is added to retry back-off delays (the actual jitter added is a random number between 0 and *wait_jitter*) (default: `1`).
97
-
98
-
**wait_exp_base**: The exponential base used to compute the retry backoff (default: `2`).
99
-
100
-
The backoff for retry attempt number _attempt_ is computed as:
0 commit comments