Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
consider how to propagate context across spawns
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Jan 9, 2024
1 parent a3b5d9f commit 9d0ea8b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/smoke-test/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@ async fn main() {

#[emit::with(trace_id: emit::new_trace_id())]
async fn in_trace() -> Result<(), io::Error> {
let mut futures = Vec::new();

for i in 0..100 {
let _ = in_ctxt(i).await;
futures.push(tokio::spawn(
emit::with(emit::empty::Empty).into_future(in_ctxt(i)),
));
}

for future in futures {
let _ = future.await;

sample_metrics();
}
Expand Down

0 comments on commit 9d0ea8b

Please sign in to comment.