You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be great to add a sleep argument which defaults to asyncio.sleep to improve support for event loops besides asyncio, while keeping it working out of the box for asyncio. I like backoff and would like to stick with it, but it ended up being too much of a hassle to get it working with trio.
tenacity has this feature, with the following syntax/explanation.
You can even use alternative event loops such as curio or Trio by passing the correct sleep function:
@retry(sleep=trio.sleep)
async def my_async_function(loop):
await asks.get('https://example.org')
The text was updated successfully, but these errors were encountered:
No traction on this? :( FYI, tenacity is converging on a solution that not only allows passing in a specific sleep function (it already supports this) but automatically detects whether to use asyncio.sleep or trio.sleep: jd/tenacity#463
I think it would be great to add a
sleep
argument which defaults toasyncio.sleep
to improve support for event loops besidesasyncio
, while keeping it working out of the box forasyncio
. I like backoff and would like to stick with it, but it ended up being too much of a hassle to get it working with trio.tenacity
has this feature, with the following syntax/explanation.The text was updated successfully, but these errors were encountered: