Function await_tree::spawn

source ·
pub fn spawn<T>(
    key: impl Key,
    root_span: impl Into<Span>,
    future: T
) -> JoinHandle<T::Output>
where T: Future + Send + 'static, T::Output: Send + 'static,
Expand description

Spawns a new asynchronous task instrumented with the given root Span, returning a JoinHandle for it.

The spawned task will be registered in the current Registry with the given Key, if it exists. Otherwise, this is equivalent to tokio::spawn.