fusion_addin_framework.utils.PeriodicExecuter

class fusion_addin_framework.utils.PeriodicExecuter(interval: float, action: Callable, wait_for_action: bool = False, initial_execution: bool = False)

Creates an executer which executes the passed action periodically.

Parameters
  • interval (float) – The time in seconds to wait between calls of action.

  • action (Callable) – The function to execute periodically. Must not accept any arguments.

  • wait_for_action (bool, optional) – Determines if the time which is needed to execute the action is included in the delay time or not. Defaults to False.

  • initial_execution (bool, optional) – Determines whether the first execution is executed directly after the first start call or if the interval time is waited.

start()

Starts the periodic execution of the action.

pause()

Pauses the periodic execution. This will NOT reset the delay time. So if half of the delay is already passed, only half of the delay will be executed after the executor is started again.

reset()

Resets the delay time to its maximum/interval time again indepent of the state of the executer.

Methods

pause()

Pauses the periodic execution.

reset()

Resets the delay time to its maximum/interval time again indepent of the state of the executer.

start()

Starts the periodic execution of the action.