Skip to main content

spawn

Function spawn 

Source
pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static,
Expand description

Spawn a future on the tokio runtime with test context propagation. If the spawned task panics and the test uses DetachedPanicPolicy::FailTest (default), the panic will be reported as a test failure after the test body completes.