pale

Crates.iopale
lib.rspale
version0.1.1
created_at2025-11-16 06:05:10.011528+00
updated_at2025-12-02 23:11:41.489832+00
descriptionA Reconnecting, subscription keeping, clonable JSON RPC 2.0 Websocket Client
homepage
repositoryhttps://github.com/VilleOlof/pale
max_upload_size
id1935252
size57,246
Ville (VilleOlof)

documentation

README

pale

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

Example

// 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:?}");
}
Commit count: 0

cargo fmt