• Home
  • Raw
  • Download

Lines Matching full:runtime

6 //! can be useful if you need to use a tokio based library in an executor/runtime
15 use tokio::runtime::{Handle, Runtime};
19 /// context on a non-Tokio runtime.
21 /// It contains a [`Handle`] to the runtime. A handle to the runtime can be
22 /// obtain by calling the [`Runtime::handle()`] method.
24 /// Note that the `TokioContext` wrapper only works if the `Runtime` it is
25 /// connected to has not yet been destroyed. You must keep the `Runtime`
29 /// runtime, that runtime must be inside a call to `block_on` for the
31 /// [multi thread] runtime, even if you configure it to only spawn one
37 /// them. It then uses the context of the runtime with the timer enabled to
38 /// execute a [`sleep`] future on the runtime with timing disabled.
43 /// // This runtime has timers enabled.
44 /// let rt = tokio::runtime::Builder::new_multi_thread()
49 /// // This runtime has timers disabled.
50 /// let rt2 = tokio::runtime::Builder::new_multi_thread()
61 /// [`Handle`]: struct@tokio::runtime::Handle
62 /// [`Runtime::handle()`]: fn@tokio::runtime::Runtime::handle
66 /// [current thread]: fn@tokio::runtime::Builder::new_current_thread
67 /// [enables time]: fn@tokio::runtime::Builder::enable_time
68 /// [multi thread]: fn@tokio::runtime::Builder::new_multi_thread
77 /// Associate the provided future with the context of the runtime behind
81 /// the runtime still exists.
94 /// // This runtime has timers enabled.
95 /// let rt = tokio::runtime::Builder::new_multi_thread()
100 /// // This runtime has timers disabled.
101 /// let rt2 = tokio::runtime::Builder::new_multi_thread()
125 /// Remove the association between the Tokio runtime and the wrapped future.
147 /// this runtime's context.
152 /// them. It then uses the context of the runtime with the timer enabled to
153 /// execute a [`sleep`] future on the runtime with timing disabled.
159 /// // This runtime has timers enabled.
160 /// let rt = tokio::runtime::Builder::new_multi_thread()
165 /// // This runtime has timers disabled.
166 /// let rt2 = tokio::runtime::Builder::new_multi_thread()
179 /// [enables time]: fn@tokio::runtime::Builder::enable_time
183 impl RuntimeExt for Runtime { implementation