rholder / retrying

Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about anything.
Apache License 2.0
1.91k stars 157 forks source link

Add support for coroutines #85

Closed Pradhvan closed 4 years ago

Pradhvan commented 5 years ago
@retry(stop_max_attempt_number=7)
async def stop_after_7_attempts():
    print "Stopping after 7 attempts"

It would great to have this feature where it works for coroutines too.

lucasnad27 commented 4 years ago

tenacity is a fork of retrying that has async support. From their README:

Tenacity is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about anything. It originates from a fork of retrying which is sadly no longer maintained. Tenacity isn’t api compatible with retrying but adds significant new functionality and fixes a number of longstanding bugs.