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.

Required Associated Types

Required Methods

Implementations on Foreign Types

Implementors