Skip to main content

Simple retrying for asyncio

Project description


Simple retrying for asyncio


pip install retrying-async==1.1.0 -i


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()


assert counter == 2


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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page