Yet another retry implementation.
Project description
retry_toolkit
(Yet Another) Retry implementation for python.
Do you have code that may be subjected to intermittent failures? Then you should have a retry wapper for it. This module includes a simple retry decorator (factory) you can use. Or peek inside and copy the implementation into your own project where you can make your own tweaks.
No dependencies outside of standard python libraries
Table of Contents
Installation
pip install retry-toolkit
Examples
Defaults to 3 tries, no delays between, retry all exceptions:
from retry.simple import retry
@retry()
def foo():
some_networking_stuff()
Customize the basic behaviors like so:
from retry.simple import retry
@retry(tries=4, backoff=1, exceptions=SomeConnectionError)
def foo():
some_other_networking_stuff()
The arguments can take callables for more customization.
License
retry-toolkit is distributed under the terms of the
MIT license.
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
Built Distribution
Hashes for retry_toolkit-0.1.1-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | f7056a3dd23479c514f5fc999a8ccc8934f459470cd4de7a6c271e2765b76ffd |
|
| MD5 | b656e58fada743d8a0d93725c9796c15 |
|
| BLAKE2b-256 | 288e9aaf0b2fda21e9d5445cd7aa468fb062c2fe0eb9d52560aaa8f0fea32089 |