Simple retrying for asyncio
Project description
- info:
Simple retrying for asyncio
Installation
pip install async_retrying
Usage
import asyncio
from async_retrying import retry
counter = 0
@retry
@asyncio.coroutine
def fn():
global counter
counter += 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
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
async_retrying-0.0.1.tar.gz
(3.0 kB
view details)
File details
Details for the file async_retrying-0.0.1.tar.gz
.
File metadata
- Download URL: async_retrying-0.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a079983cdc886ce58ed0cc65f157c9aa320648ceadb128891044b4cdef1e141 |
|
MD5 | d38553106cf433580535526eec911bdd |
|
BLAKE2b-256 | f70f2b70709939774494ba408b6b5b1e8f9b88548d1174ceef1c6a97c9271e43 |