https://github.com/gi0baro/rloop
An AsyncIO event loop implemented in Rust
https://github.com/gi0baro/rloop
asyncio
Last synced: 3 months ago
JSON representation
An AsyncIO event loop implemented in Rust
- Host: GitHub
- URL: https://github.com/gi0baro/rloop
- Owner: gi0baro
- License: bsd-3-clause
- Created: 2024-11-17T18:07:09.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-01T08:52:04.000Z (9 months ago)
- Last Synced: 2025-05-11T22:43:40.755Z (8 months ago)
- Topics: asyncio
- Language: Python
- Homepage:
- Size: 132 KB
- Stars: 145
- Watchers: 9
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-python - rloop - An AsyncIO event loop implemented in Rust. (Web & Networking)
README
# RLoop
RLoop is an [AsyncIO](https://docs.python.org/3/library/asyncio.html) selector event loop implemented in Rust on top of the [mio crate](https://github.com/tokio-rs/mio).
> **Warning**: RLoop is currently a work in progress and definitely not suited for *production usage*.
> **Note:** RLoop is available on Unix systems only.
## Installation
```bash
pip install rloop
```
## Usage
```python
import asyncio
import rloop
asyncio.set_event_loop_policy(rloop.EventLoopPolicy())
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
```
## Differences from stdlib
At current time, when compared with the stdlib's event loop, RLoop doesn't support the following features:
- Unix Domain Sockets
- SSL
- debugging
RLoop also doesn't implement the following methods:
- `loop.sendfile`
- `loop.connect_accepted_socket`
- `loop.sock_recvfrom`
- `loop.sock_recvfrom_into`
- `loop.sock_sendto`
- `loop.sock_sendfile`
### `call_later` with negative delays
While the stdlib's event loop will use the actual delay of callbacks when `call_later` is used with negative numbers, RLoop will treat those as `call_soon`, and thus the effective order will follow the invocation order, not the delay.
## License
RLoop is released under the BSD License.