Skip to main content

RiQueue

Trait RiQueue 

Source
pub trait RiQueue: Send + Sync {
    // Required methods
    fn create_producer<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RiResult<Box<dyn RiQueueProducer>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_consumer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        consumer_group: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = RiResult<Box<dyn RiQueueConsumer>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_stats<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RiResult<RiQueueStats>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn purge<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Main queue trait defining queue operations.

This trait defines the core operations for queues, including creating producers and consumers, getting statistics, purging queues, and deleting queues.

Required Methods§

Source

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

Creates a new producer for this queue.

§Returns

A RiResult<Box<dyn RiQueueProducer>> containing the producer

Source

fn create_consumer<'life0, 'life1, 'async_trait>( &'life0 self, consumer_group: &'life1 str, ) -> Pin<Box<dyn Future<Output = RiResult<Box<dyn RiQueueConsumer>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a new consumer for this queue with the given consumer group.

§Parameters
  • consumer_group: The name of the consumer group
§Returns

A RiResult<Box<dyn RiQueueConsumer>> containing the consumer

Source

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

Gets statistics for this queue.

§Returns

A RiResult<RiQueueStats> containing the queue statistics

Source

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

Purges all messages from this queue.

§Returns

A RiResult<()> indicating success or failure

Source

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

Deletes this queue.

§Returns

A RiResult<()> indicating success or failure

Implementors§