pub trait ProducerBackend: Send + Sync {
// Required methods
fn send_raw<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
message: &'life2 RawMessage,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn send_raw_default<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 RawMessage,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn send_raw_delayed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
message: &'life2 RawMessage,
delay: Duration,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn send_raw_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
messages: &'life2 [RawMessage],
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<MessageId>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn config(&self) -> &ProducerConfig;
}Expand description
消息生产者后端 trait (dyn 兼容)
Required Methods§
Sourcefn send_raw<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
message: &'life2 RawMessage,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_raw<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
message: &'life2 RawMessage,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
发送原始消息到指定队列
Sourcefn send_raw_default<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 RawMessage,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_raw_default<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 RawMessage,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
发送原始消息到默认队列
Sourcefn send_raw_delayed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
message: &'life2 RawMessage,
delay: Duration,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_raw_delayed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
message: &'life2 RawMessage,
delay: Duration,
) -> Pin<Box<dyn Future<Output = WaeResult<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
发送延迟消息
Sourcefn send_raw_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
messages: &'life2 [RawMessage],
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<MessageId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_raw_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
messages: &'life2 [RawMessage],
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<MessageId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
批量发送消息
Sourcefn config(&self) -> &ProducerConfig
fn config(&self) -> &ProducerConfig
获取生产者配置