From 8e08074cb887d1704805efb495ffb59c1115bc83 Mon Sep 17 00:00:00 2001 From: huntc Date: Wed, 22 Feb 2023 14:08:13 +1100 Subject: [PATCH 1/2] Document the nature of the main future --- tokio-macros/src/lib.rs | 7 +++++++ tokio/src/runtime/runtime.rs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index 34041afa4c5..6e78625b1aa 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -39,6 +39,13 @@ use proc_macro::TokenStream; /// function is called often, it is preferable to create the runtime using the /// runtime builder so the runtime can be reused across calls. /// +/// # Non-worker async function +/// +/// Note that the this async function does not run as a +/// worker. The expectation is that other tasks are spawned by the function here. +/// Awaiting on other futures from the function provided here will not +/// perform as fast as those spawned as workers. +/// /// # Multi-threaded runtime /// /// To use the multi-threaded runtime, the macro can be configured using diff --git a/tokio/src/runtime/runtime.rs b/tokio/src/runtime/runtime.rs index c11fc585363..60c3fc77670 100644 --- a/tokio/src/runtime/runtime.rs +++ b/tokio/src/runtime/runtime.rs @@ -240,6 +240,13 @@ impl Runtime { /// complete, and yielding its resolved result. Any tasks or timers /// which the future spawns internally will be executed on the runtime. /// + /// # Non-worker future + /// + /// Note that the future required by this function does not run as a + /// worker. The expectation is that other tasks are spawned by the future here. + /// Awaiting on other futures from the future provided here will not + /// perform as fast as those spawned as workers. + /// /// # Multi thread scheduler /// /// When the multi thread scheduler is used this will allow futures From 27893f9889eda2993aef3c62b8357d9c2c71be08 Mon Sep 17 00:00:00 2001 From: Christopher Hunt Date: Thu, 23 Feb 2023 08:46:13 +1100 Subject: [PATCH 2/2] Update tokio-macros/src/lib.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply review feedback Co-authored-by: Tymoteusz Wiśniewski --- tokio-macros/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index 6e78625b1aa..11bbbaec811 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -41,7 +41,7 @@ use proc_macro::TokenStream; /// /// # Non-worker async function /// -/// Note that the this async function does not run as a +/// Note that the async function marked with this macro does not run as a /// worker. The expectation is that other tasks are spawned by the function here. /// Awaiting on other futures from the function provided here will not /// perform as fast as those spawned as workers.