We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basics:
call_soon
call_later
Nice to have:
asyncio.Future
Having pyo3 and a Py<EventLoop> ref (could be stored in Rust) should be enough:
pyo3
Py<EventLoop>
fn my_rust_fn(event_loop: &Py<EventLoop>, callback: PyObject) { let arg = "foo"; let args: PyObject = Python::with_gil(|py| (arg,).into_py_any(py).unwrap()); // call soon event_loop.schedule(callback, args); // call later (5s) event_loop.schedule_later(std::time::Duration::new(5, 0), callback, args); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Basics:
call_soon
)call_later
)Nice to have:
asyncio.Future
that allows to set a result from Rust and react to cancellationsHaving
pyo3
and aPy<EventLoop>
ref (could be stored in Rust) should be enough:The text was updated successfully, but these errors were encountered: