pub fn spawn<F, E>(fut: F) -> ManagedFutureExpand description
Spawns a future ito its own Tokio task.
Use this in [ManagedProc::start_task] implementations when your future
is Send + 'static. This is the preferred approach as it allows the process
to run independently on the Tokio runtime.
§Example
ⓘ
impl ManagedProc for MyDaemon {
fn run_proc(self: Box<Self>, shutdown: ShutdownSignal) -> ManagedFuture {
super_visor::spawn(self.run(shutdown))
}
}