Module runtime

Module runtime 

Source

Functions§

future_into_py
get_tokio_runtime
initialize
is_main_thread
Returns true if the current thread is the main Python thread. Compares the current thread’s native ID against the main Python thread’s native ID.
monarch_with_gil
Async wrapper around Python::attach intended for async call sites.
monarch_with_gil_blocking
Blocking wrapper around Python::with_gil for use in synchronous contexts.
register_python_bindings
Initialize the runtime module and expose Python functions
shutdown_tokio_runtime
signal_safe_block_on
Block the current thread on a future, but make sure to check for signals originating from the Python signal handler.
sleep_indefinitely_for_unit_tests
A test function that sleeps indefinitely in a loop. This is used for testing signal handling in signal_safe_block_on. The function will sleep forever until interrupted by a signal.