File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -20,18 +20,16 @@ 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 ( ) ;
29
- RUNTIME
30
- . get_or_init ( || {
31
- let rt = TokioRuntime ( tokio:: runtime:: Runtime :: new ( ) . unwrap ( ) ) ;
32
- Arc :: new ( rt)
33
- } )
34
- . clone ( )
27
+ pub ( crate ) fn get_tokio_runtime ( ) -> & ' static TokioRuntime {
28
+ static RUNTIME : OnceLock < TokioRuntime > = OnceLock :: new ( ) ;
29
+ RUNTIME . get_or_init ( || {
30
+ let rt = TokioRuntime ( tokio:: runtime:: Runtime :: new ( ) . unwrap ( ) ) ;
31
+ rt
32
+ } )
35
33
}
36
34
37
35
/// Utility to collect rust futures with GIL released
You can’t perform that action at this time.
0 commit comments