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.

make_callback()

Makes the callback and resets the timer.

close(timeout: float | None = None) None[source]

Merge the threads and terminate.

make_callback() None[source]

Makes the callback and resets the timer.