retry icon indicating copy to clipboard operation
retry copied to clipboard

Nees a more threaded solution for sleep

Open brookman1 opened this issue 5 years ago • 1 comments

Python has a consent of GIL since threads in Python are virtual. time.sleep stops execution of all the threads, so uses in Flask / Django / Twisted Matrix [used in Jupyter] are impaired.

api.py uses time.sleep(...), shout be more of:

from threading import Condition
c = Condition()
c.acquire()
c.wait(_delay)
c.release()

instead of time.sleep(...) . all references to time module should be removed from api.py.

In any case, thanks for the code! Lots of quirks handled nicely! Not sure what I'd do without it!

brookman1 avatar Mar 05 '20 00:03 brookman1

I made a sample fix on a fork here: https://github.com/brookman1/retry.git. Also, enabled tests to run after commit.

brookman1 avatar May 05 '20 15:05 brookman1