Skip to main content

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


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 hashes)

Uploaded Source

Built Distribution

refry-0.1.0-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page