invl / retry

easy to use retry decorator in python
Other
714 stars 114 forks source link

Support async / await #14

Open sametmax opened 7 years ago

sametmax commented 7 years ago

Right now if you want to use retry with asyncio, you need to write all calls into a run_until_complete.

leshchenko1979 commented 2 years ago

Async function support has been added to https://github.com/leshchenko1979/reretry

jerber commented 2 years ago

@leshchenko1979 it looks like this repo no longer exists. Is there a place to find it?

jerber commented 2 years ago

I forked this and made it work for async: https://github.com/jerber/retry-async.

Example:

from retry_async import retry

@retry(is_async=True)
async def example_async() -> bool:
    return True

@retry(is_async=False)
def example_sync() -> bool:
    return True
leshchenko1979 commented 2 years ago

@jerber I've corrected the repo link above, sorry for the confusion.

felipemoran commented 1 year ago

For those (like me) that got into this issue as well, there's also the library backoff that serves similar purpose and supports async functions.