Skip to main content

Next Gen. simple retrying for asyncio.

Project description

async_retrying

Next Gen. simple retrying for asyncio - fork/fix from https://GitHub.com/hellysmile/async_retrying but updated for Python 3.10+ only

Installation

shell

pip install async_retrying_ng

Usage

python

    import asyncio

    from async_retrying_ng import retry

    counter = 0

    @retry
    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.10+ 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_ng-0.1.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

async_retrying_ng-0.1.3-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

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