File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -20,18 +20,17 @@ use crate::TokioRuntime;
20
20
use datafusion:: logical_expr:: Volatility ;
21
21
use pyo3:: prelude:: * ;
22
22
use std:: future:: Future ;
23
- use std:: sync:: { Arc , OnceLock } ;
23
+ use std:: sync:: OnceLock ;
24
24
use tokio:: runtime:: Runtime ;
25
25
26
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 ( ) ;
27
+ pub ( crate ) fn get_tokio_runtime ( ) -> & ' static TokioRuntime {
28
+ static RUNTIME : OnceLock < TokioRuntime > = OnceLock :: new ( ) ;
29
29
RUNTIME
30
30
. get_or_init ( || {
31
31
let rt = TokioRuntime ( tokio:: runtime:: Runtime :: new ( ) . unwrap ( ) ) ;
32
- Arc :: new ( rt )
32
+ rt
33
33
} )
34
- . clone ( )
35
34
}
36
35
37
36
/// Utility to collect rust futures with GIL released
You can’t perform that action at this time.
0 commit comments