pub trait PubSubCommands {
    fn publish<'a, C, M>(&'a self, channel: C, message: M) -> Future<'a, usize>
   where
        C: Into<BulkString> + 'a + Send,
        M: Into<BulkString> + 'a + Send
; fn subscribe<'a, C>(&'a self, channel: C) -> Future<'a, PubSubStream>
   where
        C: Into<BulkString> + 'a + Send
; }
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