Skip to content

Commit

Permalink
track task spawn location for tokio instrumentation (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
hds committed Sep 11, 2024
1 parent 287985e commit 6502b5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub(crate) use tls::TlsConfig;
///
/// This must be called from an async block
/// or function running on a runtime.
#[track_caller]
pub(crate) fn spawn<F, O>(fut: F) -> AsyncJoinHandle<O>
where
F: Future<Output = O> + Send + 'static,
Expand Down
1 change: 1 addition & 0 deletions src/runtime/join_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::{
pub(crate) struct AsyncJoinHandle<T>(tokio::task::JoinHandle<T>);

impl<T> AsyncJoinHandle<T> {
#[track_caller]
pub(crate) fn spawn<F>(fut: F) -> Self
where
F: Future<Output = T> + Send + 'static,
Expand Down

0 comments on commit 6502b5f

Please sign in to comment.