🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

async-retrying-ng

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-retrying-ng

Next Gen. simple retrying for asyncio.

0.1.3
PyPI
Maintainers
1

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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts