poll
¶
Utilities for polling, retrying, and exception handling.
-
poll.
poll
(until, timeout=15, interval=1)¶ Decorator for functions that should be retried until a condition or a timeout.
Parameters: >>> class TestPoll: ... def __init__(self): ... self.x = 0 ... @poll(lambda x: x == 3, interval=0.01) ... def test(self): ... print(self.x) ... self.x += 1 ... return self.x >>> TestPoll().test() 0 1 2 3