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§
Sourcefn 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 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,
接收原始消息
Sourcefn 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 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,
确认消息
Sourcefn 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 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,
拒绝消息
Sourcefn config(&self) -> &ConsumerConfig
fn config(&self) -> &ConsumerConfig
获取消费者配置