Crate circulate[−][src]
Expand description
Circulate is a lightweight async PubSub framework. It currently requires tokio.
This project is written for BonsaiDb. However, it’s a general-purpose PubSub implementation that can be utilized in any tokio-based Rust codebase.
let relay = Relay::default();
let subscriber = relay.create_subscriber().await;
subscriber.subscribe_to("some topic").await;
relay.publish("some topic", &AnySerializableType).await?;
let message = subscriber.receiver().recv_async().await?;
println!(
"Received message on topic {}: {:?}",
message.topic,
message.payload::<AnySerializableType>()?
);
Re-exports
pub use flume;
Structs
A PubSub
message.
Manages subscriptions and notifications for PubSub
.
A subscriber for Message
s published to subscribed topics.