edgy-s
A minimalist WebSocket bidirectional RPC framework for building complex microservice applications with elegant, function-based routing.
Features
- Minimalist API - Bind functions as routes with a single call
- Bidirectional RPC - Both client and server can initiate remote calls
- Type Safe - Full type safety with serde serialization
- Automatic Path Derivation - Routes are auto-generated from function names
- Zero Boilerplate - No macros, no complex configuration
- Feature Flags - Include only what you need (client/server)
Quick Start
Add Dependency
[]
= { = "0.1", = ["server", "client"] }
Server Example
use ;
async
// Define your API function
async
Client Example
use ;
async
// Client can also handle server calls
async
Request ID Configuration
Choose the appropriate request ID width based on your concurrency needs:
| Feature | Type | Max Concurrent Requests |
|---|---|---|
req_id_u8 (default) |
u8 | 256 |
req_id_u16 |
u16 | 65,536 |
req_id_u32 |
u32 | ~4.2 billion |
req_id_u64 |
u64 | Virtually unlimited |
[]
= { = "0.1", = ["server", "client", "req_id_u32"] }
Feature Flags
| Flag | Description |
|---|---|
client |
Enable WebSocket client functionality |
server |
Enable WebSocket server functionality |
req_id_u8 |
Use u8 for request IDs (default) |
req_id_u16 |
Use u16 for request IDs |
req_id_u32 |
Use u32 for request IDs |
req_id_u64 |
Use u64 for request IDs |
API Design Philosophy
Function as Route
Routes are automatically derived from function names:
async
// Route: /my/api/handler
Bind is Register
my_handler.bind.await?; // Registers and connects
my_handler.unbind.await?; // Unregisters and disconnects
Arguments as Call
// Call remote with arguments
.call_remotely.await
License
Licensed under Apache-2.0.