Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pnpnpn/retry-decorator
Decorator for retrying when exceptions occur
https://github.com/pnpnpn/retry-decorator
decorators exception-handling python python-decorators retry retry-library retryer retrying
Last synced: 8 days ago
JSON representation
Decorator for retrying when exceptions occur
- Host: GitHub
- URL: https://github.com/pnpnpn/retry-decorator
- Owner: pnpnpn
- License: mit
- Created: 2012-11-29T02:10:33.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2021-12-11T22:42:11.000Z (almost 3 years ago)
- Last Synced: 2024-11-06T15:54:24.507Z (14 days ago)
- Topics: decorators, exception-handling, python, python-decorators, retry, retry-library, retryer, retrying
- Language: Python
- Size: 29.3 KB
- Stars: 27
- Watchers: 5
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
.. image:: https://badge.fury.io/py/retry_decorator.svg
:target: https://badge.fury.io/py/retry_decorator.. image:: https://travis-ci.org/pnpnpn/retry-decorator.svg?branch=master
:target: https://travis-ci.org/pnpnpn/retry-decorator
Usage
-----Retry decorator
::
#!/usr/bin/env python
from __future__ import print_function
from retry_decorator import *@retry(Exception, tries = 3, timeout_secs = 0.1)
def test_retry():
import sys
print('hello', file = sys.stderr)
raise Exception('Testing retry')if __name__ == '__main__':
try:
test_retry()
except Exception as e:
print('Received the last exception')Contribute
---------------
I would love for you to fork and send me pull request for this project. Please contribute.