TMC Common TimeKeeper
1. TimeKeeper
A module that implements the timekeeper class
- class ska_tmc_common.timekeeper.TimeKeeper(time_out: int, logger: <Mock id='140400419702912'>)
A class that maintains the functions required for the timeout functionality.
- start_timer(timeout_id: str, timeout_callback: TimeoutCallback) None
Starts a timer for the command execution which will run for the specified amount of time. After the timer runs out, it will execute the timeout handler method.
- Parameters:
timeout_id (str) – Id for TimeoutCallback class object.
timeout_callback (TimeoutCallback) – An instance of TimeoutCallback class that acts as a callable functions to call in the event of timeout.
- Return type:
None
- timeout_handler(timeout_id: str, timeout_callback: TimeoutCallback) None
Updates the timeout callback to reflect timeout failure.
- Parameters:
timeout_id (str) – Id for TimeoutCallback class object.
timeout_callback (TimeoutCallback) – An instance of TimeoutCallback class that acts as a callable functions to call in the event of timeout.
- Return type:
None
- stop_timer() None
Stops the timer for command execution