Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hellysmile/async_retrying
Simple retrying for asyncio
https://github.com/hellysmile/async_retrying
Last synced: 29 days ago
JSON representation
Simple retrying for asyncio
- Host: GitHub
- URL: https://github.com/hellysmile/async_retrying
- Owner: hellysmile
- License: mit
- Created: 2017-01-26T11:57:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-20T12:27:57.000Z (almost 2 years ago)
- Last Synced: 2024-11-10T22:24:30.241Z (2 months ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/async_retrying
- Size: 23.4 KB
- Stars: 21
- Watchers: 20
- Forks: 9
- Open Issues: 14
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
async_retrying
==============:info: Simple retrying for asyncio
.. image:: https://img.shields.io/travis/wikibusiness/async_retrying.svg
:target: https://travis-ci.org/wikibusiness/async_retrying.. image:: https://img.shields.io/pypi/v/async_retrying.svg
:target: https://pypi.python.org/pypi/async_retryingInstallation
------------.. code-block:: shell
pip install async_retrying
Usage
-----.. code-block:: python
import asyncio
from async_retrying import retry
counter = 0
@retry
@asyncio.coroutine
def fn():
global countercounter += 1
if counter == 1:
raise RuntimeError@asyncio.coroutine
def main():
yield from fn()loop = asyncio.get_event_loop()
loop.run_until_complete(main())
assert counter == 2
loop.close()
Python 3.3+ is required