Refry is a modern, maintained, typed easy-to-use retry decorator.
Project description
refry
You know what's better than fries? Fries cooked twice. And what's even better than twice cooked fries is triple cooked fries!
Refry is a modern, maintained, typed easy-to-use retry decorator.
Installation
pip install refry
Usage
Basic usage
import refry
@refry.retry
def function_with_problem():
raise Exception('Something bad happens here')
# This will be attempted 5 times, each time with a delay increasing
# by 5 seconds.
function_with_problem()
With custom exception:
@refry.retry(ZeroDivisionError)
def function_with_bad_division():
1 / 0
function_with_bad_division()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
refry-0.1.0.tar.gz
(2.7 kB
view details)
Built Distribution
refry-0.1.0-py3-none-any.whl
(2.9 kB
view details)
File details
Details for the file refry-0.1.0.tar.gz
.
File metadata
- Download URL: refry-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96819cd7d625b38fb12fd11f7186604522b3530f24abc1210deb93c9ae641404 |
|
MD5 | c1afeb86259f770dcac9982501e917fd |
|
BLAKE2b-256 | 6b5d57ee044dc120e4a43670d5c0297572482043c6ec8f7aacc2d23b4414ae9c |
File details
Details for the file refry-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: refry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dca5165686ea95ef262b3634c0ba6921de2ad1cd2fe3ece09e6046d2ea8c175f |
|
MD5 | d24ec71b3ff07671bc6763ddd62f4901 |
|
BLAKE2b-256 | 6fd37f7a9fec506be88f801611c8d09b7198c1a04413472265d1c73865657c6a |