Non-blocking retry mechanism in Python

I looked at several retry solutions, such as retry and retrying libraries, but all of them use time.sleep which blocks a thread.

I’m trying to understand whether there is an option to implement a retry mechanism in Python, that doesn’t block a thread. I understand that I can create an additional thread on each retry, but this could bring me very fast to thread starvation and take down my service.

I’m wondering if using asyncio may be a solution and if there is a library that implements it this way?

Source: Python Questions

LEAVE A COMMENT