mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
docs: add note about current-thread + Handle::block_on (#5264)
There's already an existing warning about this combo in the documentation for `Handle::block_on`. This commit adds a summarized version in `Runtime::handle`.
This commit is contained in:
@@ -138,6 +138,9 @@ impl Runtime {
|
|||||||
/// The returned handle can be used to spawn tasks that run on this runtime, and can
|
/// The returned handle can be used to spawn tasks that run on this runtime, and can
|
||||||
/// be cloned to allow moving the `Handle` to other threads.
|
/// be cloned to allow moving the `Handle` to other threads.
|
||||||
///
|
///
|
||||||
|
/// Calling [`Handle::block_on`] on a handle to a `current_thread` runtime is error-prone.
|
||||||
|
/// Refer to the documentation of [`Handle::block_on`] for more.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|||||||
Reference in New Issue
Block a user