pub trait MessageQueue<J> {
    // Required methods
    fn push<'life0, 'async_trait>(
        &'life0 self,
        data: J
    ) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn consume(&self, worker: &WorkerId) -> JobStreamResult<J>;
}
Available on crate feature mq only.
Expand description

Represents a message queue that can be pushed and consumed.

Required Methods§

source

fn push<'life0, 'async_trait>( &'life0 self, data: J ) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Push a new message

source

fn consume(&self, worker: &WorkerId) -> JobStreamResult<J>

Start consuming a stream of messages

Implementors§