pub trait PubSubCommands {
    fn publish<'life0, 'async_trait, C, M>(
        &'life0 self,
        channel: C,
        message: M
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
    where
        C: Into<BulkString> + Send,
        M: Into<BulkString> + Send,
        C: 'async_trait,
        M: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; fn subscribe<'life0, 'async_trait, C>(
        &'life0 self,
        channel: C
    ) -> Pin<Box<dyn Future<Output = Result<PubSubStream>> + Send + 'async_trait>>
    where
        C: Into<BulkString> + Send,
        C: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; }
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