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.2.0.tar.gz
(3.1 kB
view details)
File details
Details for the file async_retrying-0.2.0.tar.gz
.
File metadata
- Download URL: async_retrying-0.2.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e8ab1dd2d72c81299af3a886a64dbcf630a277ab15f38d15823a284dd65c43 |
|
MD5 | a15a21fc95e11491b1f0c3fbdf92f26f |
|
BLAKE2b-256 | 9f5a17cf47d69f4550f27dbb232aeeffe672e675f44a1204fcd4899327be1672 |