Function wait_for_future

Source
pub fn wait_for_future<F>(py: Python<'_>, fut: F) -> PyResult<F::Output>
where F: Future + Send, F::Output: Send,
Expand description

Utility to collect rust futures with GIL released and respond to Python interrupts such as KeyboardInterrupt. If a signal is received while the future is running, the future is aborted and the corresponding Python exception is raised.