RuaPC
A high-performance Rust RPC library that supports multiple transport protocols (TCP, WebSocket, HTTP, RDMA) with unified API, and OpenAPI integration.
Features
- Multiple Transport Protocols: TCP, WebSocket, HTTP/1.1 and HTTP/2 (h2c), RDMA (optional), and a unified protocol that supports all simultaneously
- Reverse RPC: Server can call back into client services over established HTTP/2 or WebSocket connections
- Multiple Serialization Formats: JSON (default) and MessagePack support
- OpenAPI Integration: Automatic OpenAPI 3.0 specification generation with JSON Schema support
- Built-in Documentation: RapiDoc integration for interactive API documentation
Example
Define service:
use ;
use JsonSchema;
use ;
;
Start server:
use *;
use ;
use ;
;
async
Make a request:
use *;
use ;
use ;
async
Quick Start
You can directly execute the demo programs provided in ruapc-demo:
Server
# Start the server with unified protocol (supports TCP, WebSocket, and HTTP simultaneously)
# Or start with specific protocol
Client
# Stress testing with different protocols
# Or use curl to send HTTP requests.
|
#> {
#> "Ok" : "hello HTTP"
#> }
|
#> {
#> "Ok" : [
#> "EchoService/echo",
#> "MetaService/list_methods",
#> "MetaService/openapi",
#> "GreetService/greet"
#> ]
#> }
# Access interactive API documentation
RDMA Support
# Make sure the process has unlimited memory lock limit.
# Start the server with RDMA
# Stress testing with RDMA
License
This project is dual-licensed under the MIT License and Apache License 2.0.