Skip to main content

py_runtime

Function py_runtime 

Source
pub fn py_runtime() -> &'static Runtime
Expand description

Returns the process-wide Tokio runtime used by PyO3 bindings.

The runtime is created on first use and shared for the lifetime of the process. Runtime creation failure is extremely unlikely (it only happens when the OS refuses to spawn worker threads); in that case we panic since there is no meaningful way to continue.