Skip to main content

ConsumerBackend

Trait ConsumerBackend 

Source
pub trait ConsumerBackend: Send + Sync {
    // Required methods
    fn receive_raw<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = WaeResult<Option<ReceivedRawMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn ack<'life0, 'async_trait>(
        &'life0 self,
        delivery_tag: u64,
    ) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn nack<'life0, 'async_trait>(
        &'life0 self,
        delivery_tag: u64,
        requeue: bool,
    ) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn config(&self) -> &ConsumerConfig;
}
Expand description

消息消费者后端 trait (dyn 兼容)

Required Methods§

Source

fn receive_raw<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = WaeResult<Option<ReceivedRawMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

接收原始消息

Source

fn ack<'life0, 'async_trait>( &'life0 self, delivery_tag: u64, ) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

确认消息

Source

fn nack<'life0, 'async_trait>( &'life0 self, delivery_tag: u64, requeue: bool, ) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

拒绝消息

Source

fn config(&self) -> &ConsumerConfig

获取消费者配置

Implementors§