diff --git a/crates/napi/src/tokio_runtime.rs b/crates/napi/src/tokio_runtime.rs index 7c7ac709..a3e49103 100644 --- a/crates/napi/src/tokio_runtime.rs +++ b/crates/napi/src/tokio_runtime.rs @@ -9,6 +9,10 @@ use crate::{check_status, sys, JsDeferred, JsUnknown, NapiValue, Result}; pub(crate) static RT: Lazy = Lazy::new(|| tokio::runtime::Runtime::new().expect("Create tokio runtime failed")); +pub fn runtime() -> &'static Runtime { + &RT +} + /// Spawns a future onto the Tokio runtime. /// /// Depending on where you use it, you should await or abort the future in your drop function.