Trait jsonrpc_utils::pubsub::PubSub
source · [−]pub trait PubSub {
type Stream: Stream<Item = PublishMsg> + Send;
fn subscribe(&self, params: Params) -> Result<Self::Stream, Error>;
}
Expand description
Implement this trait to define actual pub/sub logic.
Streams
Stream wrappers from tokio-stream can be used, e.g. BroadcastStream
.
Or use the async-stream crate to implement streams with async-await. See the example server.