clasp-client
Async client library for CLASP (Creative Low-Latency Application Streaming Protocol).
Usage
use clasp_client::{Clasp, ClaspBuilder};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = ClaspBuilder::new("ws://localhost:7330")
.name("My App")
.connect()
.await?;
client.set("/lights/front/brightness", 0.75.into()).await?;
let value = client.get("/lights/front/brightness").await?;
println!("Brightness: {:?}", value);
let _unsub = client.subscribe("/lights/*", |value, addr| {
println!("{} = {:?}", addr, value);
}).await?;
client.close().await?;
Ok(())
}
Features
- Async/await API with Tokio
- WebSocket transport with automatic reconnection
- Time synchronization with server
- Pattern-based subscriptions with wildcards
Documentation
Visit clasp.to for full documentation.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Maintained by LumenCanvas | 2026