Returns a [`Handle`] to the global Tokio runtime. If a Tokio runtime is already entered on the current thread, its handle is returned directly. Otherwise a lazily-initialised global runtime is used.
()
| 34 | /// If a Tokio runtime is already entered on the current thread, its handle is |
| 35 | /// returned directly. Otherwise a lazily-initialised global runtime is used. |
| 36 | pub fn runtime() -> Handle { |
| 37 | match Handle::try_current() { |
| 38 | Ok(h) => h, |
| 39 | _ => global_runtime().handle().clone(), |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // These helpers work around DataFusion FFI callbacks that may run without an |
| 44 | // entered Tokio runtime. See https://github.com/apache/datafusion/issues/16312. |
nothing calls this directly
no test coverage detected