Trait apalis_core::mq::MessageQueue
source · 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§
sourcefn 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 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
sourcefn consume(&self, worker: &WorkerId) -> JobStreamResult<J>
fn consume(&self, worker: &WorkerId) -> JobStreamResult<J>
Start consuming a stream of messages