Expand description
Spawns a Send
-able future to the shared component runtime.
79
80
81
82
83
84
85
86
87
88
89
pub fn command<Cmd, Fut>(&self, cmd: Cmd)
where
Cmd: FnOnce(Sender<CommandOutput>, ShutdownReceiver) -> Fut + Send + 'static,
Fut: Future<Output = ()> + Send,
{
let recipient = self.shutdown.clone();
let sender = self.command.clone();
crate::spawn(async move {
cmd(sender, recipient).await;
});
}