Skip to main content

spawn_with_span

Function spawn_with_span 

Source
pub fn spawn_with_span<F, T>(
    parent: &Span,
    name: &str,
    future: F,
) -> JoinHandle<T> 
where F: Future<Output = T> + 'static + MaybeSend, T: MaybeSend + 'static,
Expand description

Like spawn but with an explicit parent span.

Events from the spawned future inherit fields from parent (e.g. fed_id from the client span), including the lifecycle events emitted by crate::task::TaskGroup around the user future.