Expand description
§Whispeer
whispeer is a Rust-native, lightweight, end-to-end encrypted + compressed Pub/Sub broker designed for secure messaging, real-time applications, and extensible event-driven systems.
§Core Features
- Broker Core
- Topic registry
- Subscriber management
- Publish/subscribe API
- Compression Engine
- Default: zstd
- Encryption Engine
- Default: ChaCha20Poly1305
- Transport
- QUIC-based transport for secure and efficient communication.
- Async Support
- Built on the Tokio runtime.
- Async subscribers.
- Plugin System
- Easily extend functionality with custom plugins.
- Typed Messages
- Support for generic message types via
serde::Serializeandserde::Deserialize.
- Support for generic message types via
§Simple Example
use whispeer::Broker;
use serde::{Serialize, Deserialize};
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
struct MyData {
name: String,
id: i32
}
#[tokio::main]
async fn main() {
let broker = Broker::new();
let topic = "some-event";
// Subscribe to a topic with a specific type
broker.subscribe(topic, |data: MyData| {
Box::pin(async move {
println!("Received data: {:?}", data);
})
});
// Publish data to the topic
let my_data = MyData {
name: "myname".to_string(),
id: 123
};
if let Err(e) = broker.publish(topic, my_data).await {
eprintln!("Failed to publish: {}", e);
}
}Re-exports§
pub use broker::Broker;pub use aes;pub use aes_gcm;pub use anyhow;pub use async_compression;pub use async_trait;pub use base64;pub use dashmap;pub use futures;pub use quinn;pub use rustls;pub use thiserror;pub use tokio;pub use uuid;