| Crates.io | clasp-router |
| lib.rs | clasp-router |
| version | 3.1.0 |
| created_at | 2026-01-16 04:35:04.247775+00 |
| updated_at | 2026-01-25 07:23:23.490174+00 |
| description | CLASP message router and server |
| homepage | https://clasp.to |
| repository | https://github.com/lumencanvas/clasp |
| max_upload_size | |
| id | 2047901 |
| size | 332,491 |
Message router and server for CLASP (Creative Low-Latency Application Streaming Protocol).
* and **use clasp_router::{Router, RouterConfig};
use clasp_core::SecurityMode;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let router = Router::new(RouterConfig {
name: "My Router".into(),
max_sessions: 100,
session_timeout: 60,
features: vec!["param".into(), "event".into()],
security_mode: SecurityMode::Open,
max_subscriptions_per_session: 100,
});
// Serve on WebSocket
router.serve_websocket("0.0.0.0:7330").await?;
Ok(())
}
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Client1 │ │ Client2 │ │ Client3 │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└───────────────┼───────────────┘
│
┌──────▼──────┐
│ Router │
│ - State │
│ - Fanout │
│ - Sessions │
└─────────────┘
| Metric | Value |
|---|---|
| E2E throughput | 173k msg/s |
| Fanout 100 subs | 175k deliveries/s |
| Events (no state) | 259k msg/s |
| Late-joiner replay | Yes (chunked snapshots) |
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Maintained by LumenCanvas