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§
Sourcefn prefetch_count(
self: Box<Self>,
prefetch_count: u16,
) -> Box<dyn BrokerBuilder>
fn prefetch_count( self: Box<Self>, prefetch_count: u16, ) -> Box<dyn BrokerBuilder>
Set the prefetch count.
Sourcefn declare_queue(self: Box<Self>, name: &str) -> Box<dyn BrokerBuilder>
fn declare_queue(self: Box<Self>, name: &str) -> Box<dyn BrokerBuilder>
Declare a queue.