BrokerBuilder

Trait BrokerBuilder 

Source
pub trait BrokerBuilder: Send + Sync {
    // Required methods
    fn new(broker_url: &str) -> Self
       where Self: Sized;
    fn prefetch_count(
        self: Box<Self>,
        prefetch_count: u16,
    ) -> Box<dyn BrokerBuilder>;
    fn declare_queue(self: Box<Self>, name: &str) -> Box<dyn BrokerBuilder>;
    fn heartbeat(
        self: Box<Self>,
        heartbeat: Option<u16>,
    ) -> Box<dyn BrokerBuilder>;
    fn build<'life0, 'async_trait>(
        &'life0 self,
        connection_timeout: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Broker>, BrokerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A BrokerBuilder is used to create a type of broker with a custom configuration.

Required Methods§

Source

fn new(broker_url: &str) -> Self
where Self: Sized,

Create a new BrokerBuilder.

Source

fn prefetch_count( self: Box<Self>, prefetch_count: u16, ) -> Box<dyn BrokerBuilder>

Set the prefetch count.

Source

fn declare_queue(self: Box<Self>, name: &str) -> Box<dyn BrokerBuilder>

Declare a queue.

Source

fn heartbeat(self: Box<Self>, heartbeat: Option<u16>) -> Box<dyn BrokerBuilder>

Set the heartbeat.

Source

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

Construct the Broker with the given configuration.

Implementors§