Skip to content

Commit

Permalink
macros: #[tokio::main] can be used on non-main (#3199)
Browse files Browse the repository at this point in the history
  • Loading branch information
pickfire committed Nov 30, 2020
1 parent a85fdb8 commit 72d6346
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tokio-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ use proc_macro::TokenStream;
/// [Builder](../tokio/runtime/struct.Builder.html), which provides a more
/// powerful interface.
///
/// Note: This macro can be used on any function and not just the `main`
/// function. Using it on a non-main function makes the function behave
/// as if it was synchronous by starting a new runtime each time it is called.
/// If the function is called often, it is preferable to create the runtime using
/// the runtime builder so the runtime can be reused across calls.
///
/// # Multi-threaded runtime
///
/// To use the multi-threaded runtime, the macro can be configured using
Expand Down

0 comments on commit 72d6346

Please sign in to comment.