File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ use pyo3::types::PyCapsule;
2727use std:: future:: Future ;
2828use std:: sync:: OnceLock ;
2929use std:: time:: Duration ;
30- use tokio:: runtime:: Runtime ;
3130
3231/// Utility to get the Tokio Runtime from Python
3332#[ inline]
@@ -48,23 +47,13 @@ pub(crate) fn get_global_ctx() -> &'static SessionContext {
4847 CTX . get_or_init ( SessionContext :: new)
4948}
5049
51- /// Gets the Tokio runtime with time enabled and enters it, returning both the runtime and enter guard
52- /// This helps ensure that we don't forget to call enter() after getting the runtime
53- #[ inline]
54- pub ( crate ) fn get_and_enter_tokio_runtime (
55- ) -> ( & ' static Runtime , tokio:: runtime:: EnterGuard < ' static > ) {
56- let runtime = & get_tokio_runtime ( ) . 0 ;
57- let enter_guard = runtime. enter ( ) ;
58- ( runtime, enter_guard)
59- }
60-
6150/// Utility to collect rust futures with GIL released and interrupt support
6251pub fn wait_for_future < F > ( py : Python , f : F ) -> PyResult < F :: Output >
6352where
6453 F : Future + Send + ' static ,
6554 F :: Output : Send + ' static ,
6655{
67- let ( runtime, _enter_guard ) = get_and_enter_tokio_runtime ( ) ;
56+ let runtime = & get_tokio_runtime ( ) . 0 ;
6857 // Define the milisecond interval for checking Python signals
6958 const SIGNAL_CHECK_INTERVAL : Duration = Duration :: from_millis ( 1_000 ) ;
7059
You can’t perform that action at this time.
0 commit comments