pub fn spawn<F, Fut>(
name: &str,
stop: CancellationToken,
make: F,
) -> Result<LocalTask>Expand description
Runs make on a dedicated thread, in a current-thread runtime.
make is called on that thread, so it may build values that are not Send.
Only the closure has to cross. The returned handle cancels stop, which
make gets to watch.
ยงErrors
Fails if the runtime or the thread cannot be started.