dkutils.wait_loop module¶
- class dkutils.wait_loop.WaitLoop(sleep_secs, duration_secs)[source]¶
Bases:
object
WaitLoop is for use in a while loop. Create an instance of this class and add it as the condition/expression to the while loop.
- Parameters
sleep_secs (int) – Number of seconds to sleep in between loop executions.
duration_secs (int) – Max duration in seconds after which the loop will exit.
- __bool__()[source]¶
Determines if the loop should exit.
- Returns
True if loop should exit, False otherwise.
- Return type
bool
- __init__(sleep_secs, duration_secs)[source]¶
WaitLoop is for use in a while loop. Create an instance of this class and add it as the condition/expression to the while loop.
- Parameters
sleep_secs (int) – Number of seconds to sleep in between loop executions.
duration_secs (int) – Max duration in seconds after which the loop will exit.