Hello Iceoryx community !
I want to annonce a new project running with iceoryx2 :
ice-rpc lib : a zero-copy RPC over iceoryx2
What is it?
ice-rpc is a high-performance, zero-copy Rust RPC framework built on top of iceoryx2 shared memory. From a single #[service] annotated trait, it generates all the IPC plumbing: client, server, proxy and lifecycle.
Highlights
- Zero-copy transport : requests and responses are serialized with rkyv directly into iceoryx2 shared memory, with no intermediate copies.
- Full code generation with a proc macro : one #[service] trait yields the Request enum, Client, Server, Proxy and lifecycle.
- Service discovery : a per-node registry with dependency-aware, topological initialization (ServiceInit + dependencies()).
- Crash detection without heartbeat : a kernel named lock (Windows Mutex / Unix flock) detects hard crashes, including SIGKILL, and triggers automatic reconnection.
- Runtime-agnostic core : runs on tokio, smol, or pollster via optional features tokio, smol, and http.
- Optional HTTP gateway : exposes any service as a REST endpoint /{service}/{method} using trillium.
- Node.js bridge : a NAPI gateway lets a Node.js process expose services on the same IPC bus (ProviderNodeJs mode).
Quick example
Define the service:
use ice_rpc::{service, Observable};
use rkyv::{Archive, Deserialize, Serialize};
#[derive(Debug, Archive, Deserialize, Serialize)]
pub enum MyError {
NotFound,
}
#[service("MyService")]
pub trait MyService: Send + Sync + 'static {
async fn hello(&self, name: String) -> Observable<String, MyError>;
}
Provider :
ice_rpc::init_provider();
ice_rpc::run_provider!(
MyServiceProxy::provide(MyServiceImpl),
).await
Consumer (other process):
ice_rpc::init_consumer();
let proxy = ice_rpc::locator()
.get::<MyServiceProxy>().await?;
let response: String = ice_rpc::take_one!(proxy.hello("Alice".into()))?;
println!("Response: {}", response);
Status
crates.io: ice-rpc 0.1.0 · ice-rpc-macros 0.1.0
License: Apache-2.0
Repository: GitHub - max3163/ice-rpc: Zero-copy RPC over iceoryx2 with service discovery · GitHub
Feedback, questions, or benchmark ideas are welcome !
It’s my first lib in rust and still work in progress