Streaming

Trait Streaming 

Source
pub trait Streaming {
    // Required method
    fn listen<'life0, 'async_trait>(
        &'life0 self,
        callback: Box<dyn Fn(Message) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync + 'async_trait>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Streaming interface to listen message.

Required Methods§

Source

fn listen<'life0, 'async_trait>( &'life0 self, callback: Box<dyn Fn(Message) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync + 'async_trait>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start listening stream messages. When receive a message, the callback function will be called.

Implementors§