retry icon indicating copy to clipboard operation
retry copied to clipboard

Support async / await

Open sametmax opened this issue 7 years ago • 5 comments

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

sametmax avatar Mar 01 '17 09:03 sametmax

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

leshchenko1979 avatar May 05 '22 14:05 leshchenko1979

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

jerber avatar Oct 12 '22 17:10 jerber

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

jerber avatar Oct 12 '22 19:10 jerber

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

leshchenko1979 avatar Oct 13 '22 05:10 leshchenko1979