xrpc-rs 0.1.8

async RPC library optimized for shared memory communication
Documentation

xRPC-rs

High-performance local IPC library for Rust with seamless transport flexibility.

Designed for multi-process applications on the same machine. Start with in-process channels for development, scale to shared memory for production IPC, and extend to TCP for network deployment—all with the same interface.

Status: Very early prototype - It is working but not production-ready.

Architecture

xRPC follows a layered architecture:

Layer Trait/Module Description Status
Layer 1 Transport Low-level byte transmission (TCP, Unix, SharedMemory, Channel) completed
Layer 2 MessageTransport Message-aware transport with compression completed
Layer 3 RpcClient/RpcServer RPC with method dispatch, streaming, request/response correlation not implemented
Layer 4 Advanced Batching, service discovery, load balancing not impelmented
Application
    ↓
RpcClient/RpcServer (Layer 3)
    ↓
MessageTransport (Layer 2) with compression
    ↓
Transport (Layer 1) raw bytes with framing
    ↓
Network/IPC

Documentation

Examples

Byte-level Transports

Layer 1 transports (Channel, TCP, RawTransport, TypedChannel):

cargo run --example byte_transports

MessageTransport with SharedMemory

Local RPC using Message protocol over shared memory:

# Terminal 1: Start server

cargo run --example message_transport_shm -- server


# Terminal 2: Run client

cargo run --example message_transport_shm -- client

Future Plans

Completed

  • Add support for streaming & compression on message
  • Transport layer abstraction
  • Local Channel Transport implementation
  • SharedMemory Transport implementation
  • Heartbeat abstraction for transport reliability
  • RawTransport (skip Message protocol overhead)
  • ArcTransport (Arc-based, no serialization)

Refactoring Tasks

  • Module reorganization: Split protocol.rs into message module.
  • Codec trait abstraction: Decouple serialization format
  • Relocate TypedChannel

Planned Features

  • Network transports (TCP, Unix socket)
  • MessageTransport (Layer 2) - Message-aware transport adapter
  • Examples for Transports
  • High-level Client/Server architecture (Layer 3)
  • Streaming support
  • Batching support
  • Service Discovery & Load Balancing

License

This project is licensed under the MIT License - see the LICENSE file for details.