pub fn spawn_automaton_task<A>(
automaton: A,
interval: Duration,
value_tx: Sender<f64>,
cancel_rx: Receiver<bool>,
) -> JoinHandle<()>where
A: Automaton + 'static,Expand description
Run an automaton as a green thread (tokio task)
§Arguments
automaton— implementation of theAutomatontraitinterval— update frequency (e.g. 10 ms for 100 Hz)value_tx— channel for sending values to PortCombinercancel_rx— cancellation signal (from PortCombinerHandle::cancel_rx)
Returns a JoinHandle. Dropping the handle does not stop the
task. Use the cancellation signal to stop it.