šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

retrying-async

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retrying-async

Simple retrying for asyncio

2.0.0
PyPI
Maintainers
1

async_retrying

:info: Simple retrying for asyncio

Installation

.. code-block:: shell

pip install retrying-async==1.1.0 -i https://pypi.org/pypi

Usage

.. code-block:: python

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

Keywords

asyncio

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