PubSubConnection

Trait PubSubConnection 

Source
pub trait PubSubConnection {
    // Required methods
    fn subscribe<'life0, 'async_trait>(
        &'life0 mut self,
        channels: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unsubscribe<'life0, 'async_trait>(
        &'life0 mut self,
        channels: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn psubscribe<'life0, 'async_trait>(
        &'life0 mut self,
        patterns: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn punsubscribe<'life0, 'async_trait>(
        &'life0 mut self,
        patterns: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn listen<'life0, 'async_trait>(
        &'life0 mut self,
        message_tx: UnboundedSender<PubSubMessage>,
    ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn publish<'life0, 'async_trait>(
        &'life0 mut self,
        channel: String,
        message: String,
    ) -> Pin<Box<dyn Future<Output = RedisResult<i64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for Pub/Sub connections

Required Methods§

Source

fn subscribe<'life0, 'async_trait>( &'life0 mut self, channels: Vec<String>, ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to channels

Source

fn unsubscribe<'life0, 'async_trait>( &'life0 mut self, channels: Vec<String>, ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unsubscribe from channels

Source

fn psubscribe<'life0, 'async_trait>( &'life0 mut self, patterns: Vec<String>, ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to patterns

Source

fn punsubscribe<'life0, 'async_trait>( &'life0 mut self, patterns: Vec<String>, ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unsubscribe from patterns

Source

fn listen<'life0, 'async_trait>( &'life0 mut self, message_tx: UnboundedSender<PubSubMessage>, ) -> Pin<Box<dyn Future<Output = RedisResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start listening for messages

Source

fn publish<'life0, 'async_trait>( &'life0 mut self, channel: String, message: String, ) -> Pin<Box<dyn Future<Output = RedisResult<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publish a message to a channel

Implementors§