DMSCQueueConsumer

Trait DMSCQueueConsumer 

Source
pub trait DMSCQueueConsumer: Send + Sync {
    // Required methods
    fn receive<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<Option<DMSCQueueMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn ack<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn nack<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn pause<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn resume<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn receive_multi<'life0, 'async_trait>(
        &'life0 self,
        count: usize,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<Vec<Option<DMSCQueueMessage>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn ack_multi<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message_ids: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Trait for consuming messages from queues.

This trait defines the interface for receiving and acknowledging messages from queues.

Required Methods§

Source

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

Receives a message from the queue.

§Returns

A DMSCResult<Option<DMSCQueueMessage>> containing the message if available, or None if no message is available

Source

fn ack<'life0, 'life1, 'async_trait>( &'life0 self, message_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Acknowledges a message, indicating it has been successfully processed.

§Parameters
  • message_id: The ID of the message to acknowledge
§Returns

A DMSCResult<()> indicating success or failure

Source

fn nack<'life0, 'life1, 'async_trait>( &'life0 self, message_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Negatively acknowledges a message, indicating it failed to process and should be retried.

§Parameters
  • message_id: The ID of the message to negatively acknowledge
§Returns

A DMSCResult<()> indicating success or failure

Source

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

Pauses message consumption.

§Returns

A DMSCResult<()> indicating success or failure

Source

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

Resumes message consumption after pausing.

§Returns

A DMSCResult<()> indicating success or failure

Provided Methods§

Source

fn receive_multi<'life0, 'async_trait>( &'life0 self, count: usize, ) -> Pin<Box<dyn Future<Output = DMSCResult<Vec<Option<DMSCQueueMessage>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn ack_multi<'life0, 'life1, 'async_trait>( &'life0 self, message_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§