PyO3 Asyncio
Rust bindings for Python's Asyncio Library. This crate facilitates interactions between Rust Futures and Python Coroutines and manages the lifecycle of their corresponding event loops.
PyO3 Asyncio is a brand new part of the broader PyO3 ecosystem. Feel free to open any issues for feature requests or bugfixes for this crate.
Known Problems
This library can give spurious failures during finalization prior to PyO3 release v0.13.2
. Make sure your PyO3 dependency is up-to-date!
Quickstart
Here we initialize the runtime, import Python's asyncio
library and run the given future to completion using Python's default EventLoop
and async-std
. Inside the future, we convert asyncio
sleep into a Rust future and await it.
More details on the usage of this library can be found in the API docs.
use *;
async