Skip to main content

MessageQueueProducer

Trait MessageQueueProducer 

Source
pub trait MessageQueueProducer: Send + Sync {
    // Required methods
    fn send<'life0, 'async_trait>(
        &'life0 self,
        message: QueueMessage,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn flush<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn send_batch<'life0, 'async_trait>(
        &'life0 self,
        messages: Vec<QueueMessage>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<()>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Message queue producer trait.

Required Methods§

Source

fn send<'life0, 'async_trait>( &'life0 self, message: QueueMessage, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a message to the queue.

Source

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

Flush pending messages.

Provided Methods§

Source

fn send_batch<'life0, 'async_trait>( &'life0 self, messages: Vec<QueueMessage>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<()>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send multiple messages in a batch.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§