An event loop for asyncio written in Rust
Actively maintained. Last release 6 days ago, commits in 18 of the last 26 weeks. A safe choice.
pip install rsloop
An event loop for asyncio written in Rust
rsloop is a PyO3-based asyncio event loop implemented in Rust.
Each rsloop.Loop owns a dedicated Rust runtime thread for loop coordination
and I/O work. That thread runs an rsloop-specialized vibeio runtime, using
io_uring on Linux, IOCP on Windows, and native kqueue readiness on macOS.
Native-stream TCP reads and Unix-domain socket reads run on that runtime. On Unix, generic
TCP protocol readers use a second vibeio runtime on the Python loop thread
(io_uring on Linux), avoiding cross-thread delivery of each read. Non-TLS accepts
run on either runtime depending on where the server starts. Python callbacks,
tasks, and coroutines run on the thread that calls
run_forever() or run_until_complete() (usually the main Python thread).
The package exposes:
- a native extension module at
rsloop._loop - a Python wrapper in
python/rsloop/__init__.py rsloop.Loop,rsloop.EventLoopPolicy,rsloop.new_event_loop(),rsloop.run(...),rsloop.install(),rsloop.uninstall(), andrsloop.build_info()
Repository metadata supports CPython 3.10 through 3.15.
The native runtime requires Linux 6.1+, macOS 13+, or Windows 10+ so its hot
paths can rely on modern completion, timer, and scheduler primitives.
Free-threaded CPython (3.14t, ) is supported: the extension declares
, so importing it no longer re-enables the GIL. See
for what that does and does not
buy you.