Simple retrying for asyncio
Project description
- info:
Simple retrying for asyncio
Installation
pip install retrying-async==1.1.0 -i https://pypi.org/pypi
Usage
import asyncio
from retrying_async import retry
counter = 0
@retry(attempts=3, delay=3)
async def fn():
global counter
counter += 1
if counter == 1:
raise RuntimeError
async def main():
await fn()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
assert counter == 2
loop.close()
Python 3.5+ 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
retrying-async-2.0.0.tar.gz
(3.0 kB
view details)
File details
Details for the file retrying-async-2.0.0.tar.gz
.
File metadata
- Download URL: retrying-async-2.0.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11e795f6c247cd4659059bdb44b1926ca1fa28854154df2cc2f9f37454f90d2d |
|
MD5 | 2ae3bfa2fb9e887d6c8837282546cdde |
|
BLAKE2b-256 | ce13cc75f529802950ee99f35f95a93c2be7ba45430f82d52ab637d2239dd94c |