8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 030ec20 commit efd2046Copy full SHA for efd2046
src/utils.rs
@@ -20,18 +20,17 @@ use crate::TokioRuntime;
20
use datafusion::logical_expr::Volatility;
21
use pyo3::prelude::*;
22
use std::future::Future;
23
-use std::sync::{Arc, OnceLock};
+use std::sync::OnceLock;
24
use tokio::runtime::Runtime;
25
26
/// Utility to get the Tokio Runtime from Python
27
-pub(crate) fn get_tokio_runtime() -> Arc<TokioRuntime> {
28
- static RUNTIME: OnceLock<Arc<TokioRuntime>> = OnceLock::new();
+pub(crate) fn get_tokio_runtime() -> &'static TokioRuntime {
+ static RUNTIME: OnceLock<TokioRuntime> = OnceLock::new();
29
RUNTIME
30
.get_or_init(|| {
31
let rt = TokioRuntime(tokio::runtime::Runtime::new().unwrap());
32
- Arc::new(rt)
+ rt
33
})
34
- .clone()
35
}
36
37
/// Utility to collect rust futures with GIL released
0 commit comments