Iris is a hybrid distributed runtime fabric designed for actors, native compute offload, and cross-language services. It combines the safety and performance of Rust with the ergonomics of Python and Node.js.
Iris implements a lightweight actor model with two distinct execution styles:
- Mechanism: Ultra-lightweight handlers triggered only when messages arrive.
- Scheduling: Managed by a cooperative reduction-based scheduler on top of Tokio.
- Scaling: Can scale to 100k+ concurrent actors.
- Budget: Each actor has a "reduction budget" and must yield when exhausted to ensure fairness.
- Mechanism: Blocking mailbox workers for synchronous control flow.
- Python usage: Run on dedicated OS threads and block on
recv()while releasing the GIL. - Benefit: Simplifies complex synchronous logic without needing
async/await.
Inspired by the BEAM (Erlang VM), Iris ensures that no single high-throughput actor can monopolize a CPU core.
- Reductions: Every operation (sending a message, processing a callback) costs "reductions".
- Yielding: When the budget is hit, the actor's future yields to the Tokio executor.
Iris allows updating live application logic without stopping the runtime.
- Zero downtime: Replace Python or Node.js handlers in memory.
- State Preservation: In-flight messages remain in the mailbox; only the "behavior" pointer is swapped.
- Versioning: Supports rolling back to previous behavior versions.
Iris nodes communicate over TCP using a length-prefixed binary protocol.
| Packet Type | Function | Payload Structure |
|---|---|---|
0x00 |
User Message | [PID: u64][LEN: u32][DATA: Bytes] |
0x01 |
Resolve Request | [LEN: u32][NAME: String] → Returns [PID: u64] |
0x02 |
Heartbeat (Ping) | [Empty] — Probe remote node health |
0x03 |
Heartbeat (Pong) | [Empty] — Acknowledge health |
Iris bridges Rust with guest languages using high-performance membranes: