Retry Helper
Helper tool fro retrying code when soem exceptions occur
Usage
RetryManager
Retry manager is context manager for retrying block of code. In fact its double layer context manager in first context you will create context manager and use while retry object is true. And the run you code in context of retry.attempt.
- max_attempts - maximum count of attempts, default 1
- wait_seconds - How many second it should wait before next retry, default 0
- exceptions - exception class or tuple of exceptions classes which cause retry, if None all exceptions cause retry default None
- reset_func - function to be run before each retry (it is not call on first try)
with RetryManager(max_attempts=20, wait_seconds=1, exceptions=(TypeError,KeyError)) as retry:
while retry:
with retry.attempt:
# code raising exception if fail
Metadata
Release files for retry-helper 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| retry_helper-0.0.4.tar.gz | 3.4 kB | Details |
Release files / retry_helper-0.0.4.tar.gz
| Download URL | retry_helper-0.0.4.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d76c1fcff4719e0916f452fc30f9828a98c64150904a5fafd6a2a37a7190d3b
|
|
BLAKE2b-256 checksum How to use checksums |
d9c812be74c0b0715f552bc417c7a50fd4763b2f30d93cba84333a8a3601fe0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
|