Skip to main content

QueueService

Trait QueueService 

Source
pub trait QueueService: Send + Sync {
    // Required methods
    async fn create_producer(
        &self,
        config: ProducerConfig,
    ) -> WaeResult<MessageProducer>;
    async fn create_consumer(
        &self,
        config: ConsumerConfig,
    ) -> WaeResult<MessageConsumer>;
    fn manager(&self) -> &dyn QueueManager;
    async fn close(&self) -> WaeResult<()>;
}
Expand description

消息队列服务 trait

Required Methods§

Source

async fn create_producer( &self, config: ProducerConfig, ) -> WaeResult<MessageProducer>

创建生产者

Source

async fn create_consumer( &self, config: ConsumerConfig, ) -> WaeResult<MessageConsumer>

创建消费者

Source

fn manager(&self) -> &dyn QueueManager

获取队列管理器

Source

async fn close(&self) -> WaeResult<()>

关闭连接

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§