pub trait PubSubCommands {
    fn publish<'a, C, M>(
        &'a self,
        channel: C,
        message: M
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + 'a>>
   where
        C: Into<BulkString> + 'a,
        M: Into<BulkString> + 'a
; fn subscribe<'a, C>(
        &'a self,
        channel: C
    ) -> Pin<Box<dyn Future<Output = Result<PubSubStream>> + 'a>>
   where
        C: Into<BulkString> + 'a
; }
Expand description

A redis connection used in a pub/sub scenario.

Required Methods

Posts a message to the given channel.

Return

Integer reply: the number of clients that received the message. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count.

See Also

https://redis.io/commands/publish/

Subscribes the client to the specified channels.

See Also

https://redis.io/commands/subscribe/

Implementors