Skip to content

Commit

Permalink
Track caller when spawning async tasks (#174)
Browse files Browse the repository at this point in the history
This allows separate calls to `spawn` to show separately in
tokio-console, rather than having it show all tasks as originating from
the `spawn` function itself.
  • Loading branch information
davidlattimore committed Oct 30, 2023
1 parent 28a05b4 commit f6ec965
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/async_rt/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub use join_handle::JoinHandle;
use std::any::Any;
use std::future::Future;

#[track_caller]
pub fn spawn<T>(task: T) -> JoinHandle<T::Output>
where
T: Future + Send + 'static,
Expand Down

0 comments on commit f6ec965

Please sign in to comment.