Sched Thread API¶
The SchedThread is a wrapper thread that runs a MachineScheduler for a single state machine.
class
automation.workers.state_machine.SchedThread(machine)A thread that runs a dedicated scheduler for a single state machine.
run(self)Starts the thread execution.
target(self, machine)The target function for the thread. Initializes and runs the scheduler.
loop_closure(self, machine, scheduler)Creates a closure for the state machine loop function.
Parameters:
- machine (StateMachine): The state machine.
- scheduler (MachineScheduler): The scheduler managing execution.
Returns:
- callable: The loop function.
stop(self)Stops the scheduler running in this thread.