Skip to content

Commit 8c3d838

Browse files
committed
link flavor in spawn_local docs
1 parent e1117ec commit 8c3d838

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tokio/src/task/local.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,14 @@ impl<'a> Drop for LocalDataEnterGuard<'a> {
326326
cfg_rt! {
327327
/// Spawns a `!Send` future on the current [`LocalSet`] or [`LocalRuntime`].
328328
///
329+
/// This is possible when either using one of these types
330+
/// explicitly, or (with `tokio_unstable`) by opting to use the
331+
/// `"local"` runtime flavor in [`tokio::main`]:
332+
///
333+
/// ```ignore
334+
/// #[tokio::main(flavor = "local")]
335+
/// ```
336+
///
329337
/// The spawned future will run on the same thread that called `spawn_local`.
330338
///
331339
/// The provided future will start running in the background immediately

0 commit comments

Comments
 (0)