parsl.utils.Timer
- class parsl.utils.Timer(callback: Callable, *args: Any, interval: float | int = 5, name: str | None = None)[source]
This class will make a callback periodically, with a period specified by the interval parameter.
This is based on the following logic :
BEGIN (INTERVAL, THRESHOLD, callback) : start = current_time() while (current_time()-start < INTERVAL) : wait() break callback()
- __init__(callback: Callable, *args: Any, interval: float | int = 5, name: str | None = None) None [source]
Initialize the Timer object. We start the timer thread here
- KWargs:
interval (int or float) : number of seconds between callback events
name (str) : a base name to use when naming the started thread
Methods
__init__
(callback, *args[, interval, name])Initialize the Timer object.
close
([timeout])Merge the threads and terminate.
Makes the callback and resets the timer.