| Crates.io | pale |
| lib.rs | pale |
| version | 0.1.1 |
| created_at | 2025-11-16 06:05:10.011528+00 |
| updated_at | 2025-12-02 23:11:41.489832+00 |
| description | A Reconnecting, subscription keeping, clonable JSON RPC 2.0 Websocket Client |
| homepage | |
| repository | https://github.com/VilleOlof/pale |
| max_upload_size | |
| id | 1935252 |
| size | 57,246 |
A Reconnecting, subscription keeping, clonable JSON RPC 2.0 Websocket Client in Rust
[!WARNING]
Use on your own risk, this was just made to suit a very specific use case that i personally needed.
I have not benchmarked this or checked any performance. And isn't thoroughly tested and probably have issues.
But hopefully the code isn't too much to scan over if you encounter any issues <3
// create & connect a client
let client = Client::new("ws://example.com", ClientConfig::default()).await?;
// a simple request
let data = client.request::<Vec<i32>>("example/method", params![("param_name", true)]).await?;
// a subscription stream
let mut sub = client.subscribe::<String>("example/notification").await?;
while let Some(data) = sub.next().await {
println!("{data:?}");
}