Skip to content

Commit

Permalink
doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mox692 committed Oct 18, 2024
1 parent e576bd3 commit 8e90e20
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions tokio/src/runtime/metrics/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,29 +681,8 @@ impl RuntimeMetrics {
}
}

/// Returns the number of tasks currently scheduled in the runtime's
/// injection queue.
///
/// Tasks that are spawned or notified from a non-runtime thread are
/// scheduled using the runtime's injection queue. This metric returns the
/// **current** number of tasks pending in the injection queue. As such, the
/// returned value may increase or decrease as new tasks are scheduled and
/// processed.
///
/// # Examples
///
/// ```
/// use tokio::runtime::Handle;
///
/// #[tokio::main]
/// async fn main() {
/// let metrics = Handle::current().metrics();
///
/// let n = metrics.injection_queue_depth();
/// println!("{} tasks currently pending in the runtime's injection queue", n);
/// }
/// ```
#[deprecated = "Renamed to global_queue_depth"]
/// Renamed to [`RuntimeMetrics::global_queue_depth`]
pub fn injection_queue_depth(&self) -> usize {
self.handle.inner.injection_queue_depth()
}
Expand Down

0 comments on commit 8e90e20

Please sign in to comment.