mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
task: clarify the behavior of several spawn_local methods (#7669)
This commit is contained in:
@@ -401,11 +401,17 @@ impl TaskTracker {
|
||||
handle.spawn(self.track_future(task))
|
||||
}
|
||||
|
||||
/// Spawn the provided future on the current [`LocalSet`], and track it in this `TaskTracker`.
|
||||
/// Spawn the provided future on the current [`LocalSet`] or [`LocalRuntime`]
|
||||
/// and track it in this `TaskTracker`.
|
||||
///
|
||||
/// This is equivalent to `tokio::task::spawn_local(tracker.track_future(task))`.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This method panics if it is called outside of a `LocalSet` or `LocalRuntime`.
|
||||
///
|
||||
/// [`LocalSet`]: tokio::task::LocalSet
|
||||
/// [`LocalRuntime`]: tokio::runtime::LocalRuntime
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
#[cfg(feature = "rt")]
|
||||
|
||||
Reference in New Issue
Block a user