Skip to content

Commit

Permalink
doc: add notes for #[tokio::test]
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyCpp committed May 18, 2021
1 parent 733bab9 commit 9a434e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
//! to use batch span processors where the spans will be sent in batch, reducing the number of requests
//! and resource needed.
//!
//! Batch span processors need to run a background task to collect and send spans. Different runtime
//! needs different ways to handle the background task.
//! Batch span processors need to run a background task to collect and send spans. Different runtimes
//! need different ways to handle the background task. Using a `Runtime` that's not compatible with the
//! underlying runtime can cause deadlock.
//!
//! ### Tokio
//!
Expand All @@ -72,6 +73,9 @@
//! task with other tasks in the same runtime. Thus, users should enable `rt-tokio-current-thread` feature
//! to ask the background task be scheduled on a different runtime on a different thread.
//!
//! Note that by default `#[tokio::test]` uses `current_thread_scheduler` and should use `rt-tokio-current-thread`
//! feature.
//!
//! ## Related Crates
//!
//! In addition to `opentelemetry`, the [`open-telemetry/opentelemetry-rust`]
Expand Down

0 comments on commit 9a434e4

Please sign in to comment.