Project Structure
This page is a map of the repository.
Top-level files
pyproject.toml: Python package metadata andmaturinbuild configurationCargo.toml: Rust crate metadata and dependenciesREADME.md: main repository overviewbuild.rs: Rust build-time scriptjustfile: useful development commands if you usejustuv.lock: locked Python dependency data foruv
Python package
Path: python/rsloop/
This is the Python-facing side of the project.
__init__.py: public exports_run.py: friendly helpers for starting the loop_loop_compat.py: behavior that makesrsloopfit intoasyncio_bootstrap.py: import-time environment setup_profile.py: profiler helpers
Think of this directory as the "Python wrapper layer".
Rust extension
Path: src/
This is the engine room of the project.
lib.rs: registers the Python extension modulepython_api.rs: large bridge between Python and Rustloop_core.rs: loop commands and stateruntime.rs: runtime orchestrationcallbacks.rs: scheduled callback supportstream_transport.rs: stream, server, and transport logicprocess_transport.rs: subprocess and pipe logictls.rs: TLS handlingfast_streams.rs: fast versions of common stream helpers
If you want to understand behavior changes, this directory is usually where the real implementation lives.
Examples
Path: examples/
This directory shows the supported feature areas in runnable form.
- basics
- sockets
- streams
- Unix sockets
- accepted sockets
- pipes
- signals
- subprocesses
Examples are a good first stop before reading tests.
Tests
Path: tests/
The tests tell you what behavior the project promises today.
test_run.py: basic lifecycle and common operationstest_compat.py:asynciocompatibility behaviorstest_tls.py: TLS-related behavior
When you are unsure whether a feature is expected to work, check the tests.
Demo
Path: demo/
This is an example FastAPI service used to compare event loops in a more realistic application.
It is helpful when you want to:
- see
rsloopin a web-service shape - compare it with stdlib
asyncioanduvloop - exercise the fast stream path
Benchmarks
Path: benchmarks/
This directory contains performance comparison tools.
It compares:
- stdlib
asyncio uvlooprsloop
Use this directory when you want numbers, not just correctness.
Scripts
Path: scripts/
These are support scripts for maintainers:
- building wheels
- testing supported Python versions
- generating TLS test certificates
- listing Python versions used by the build scripts
You usually do not need these for normal package usage, but they matter for release and CI work.