pub struct InMemoryBroker { /* private fields */ }Expand description
Production-ready sharded high-concurrency in-memory MessageBroker implementation.
Implementations§
Source§impl InMemoryBroker
Inherent implementation of InMemoryBroker.
impl InMemoryBroker
Inherent implementation of InMemoryBroker.
Sourcepub fn new(config: MqConfig) -> Self
pub fn new(config: MqConfig) -> Self
Creates a new 64-shard InMemoryBroker governed by config.
§Arguments
MqConfig- Queue capacity, retry, and visibility timeout settings.
§Returns
Self- Ready in-memory message broker.
Sourcepub fn get_config(&self) -> &MqConfig
pub fn get_config(&self) -> &MqConfig
Trait Implementations§
Source§impl Clone for InMemoryBroker
impl Clone for InMemoryBroker
Source§impl Default for InMemoryBroker
Default construction for InMemoryBroker.
impl Default for InMemoryBroker
Default construction for InMemoryBroker.
Source§fn default() -> Self
fn default() -> Self
Constructs a default InMemoryBroker value.
Source§impl MessageBroker for InMemoryBroker
Implements MessageBroker for InMemoryBroker.
impl MessageBroker for InMemoryBroker
Implements MessageBroker for InMemoryBroker.
Source§fn subscribe_group<'a>(
&'a self,
topic: &'a str,
group: &'a str,
) -> BrokerFuture<'a, ()>
fn subscribe_group<'a>( &'a self, topic: &'a str, group: &'a str, ) -> BrokerFuture<'a, ()>
Implements the subscribe_group operation on InMemoryBroker.
§Arguments
&'a self- Shared reference to a'a self.&'a str- Shared reference to a'a str.&'a str- Shared reference to a'a str.
§Returns
BrokerFuture<'a, ()>- ABrokerFuture<'a, ()>value.
Source§fn publish(&self, message: MqMessage) -> BrokerFuture<'_, u64>
fn publish(&self, message: MqMessage) -> BrokerFuture<'_, u64>
Implements the publish operation on InMemoryBroker.
§Arguments
MqMessage- AMqMessageparameter.
§Returns
BrokerFuture<'_, u64>- ABrokerFuture<'_, u64>value.
Source§fn consume<'a>(
&'a self,
topic: &'a str,
group: &'a str,
) -> BrokerFuture<'a, Option<MqDelivery>>
fn consume<'a>( &'a self, topic: &'a str, group: &'a str, ) -> BrokerFuture<'a, Option<MqDelivery>>
Implements the consume operation on InMemoryBroker.
§Arguments
&'a self- Shared reference to a'a self.&'a str- Shared reference to a'a str.&'a str- Shared reference to a'a str.
§Returns
BrokerFuture<'a, Option<MqDelivery>>- ABrokerFuture<'a, Option<MqDelivery>>value.
Source§fn ack(&self, receipt_id: u64) -> BrokerFuture<'_, ()>
fn ack(&self, receipt_id: u64) -> BrokerFuture<'_, ()>
Implements the ack operation on InMemoryBroker.
§Arguments
u64- Au64parameter.
§Returns
BrokerFuture<'_, ()>- ABrokerFuture<'_, ()>value.
Source§fn nack(&self, receipt_id: u64, requeue: bool) -> BrokerFuture<'_, ()>
fn nack(&self, receipt_id: u64, requeue: bool) -> BrokerFuture<'_, ()>
Implements the nack operation on InMemoryBroker.
§Arguments
u64- Au64parameter.bool- A boolean (bool).
§Returns
BrokerFuture<'_, ()>- ABrokerFuture<'_, ()>value.
Source§fn stats<'a>(
&'a self,
topic: &'a str,
group: &'a str,
) -> BrokerFuture<'a, MqStats>
fn stats<'a>( &'a self, topic: &'a str, group: &'a str, ) -> BrokerFuture<'a, MqStats>
Implements the stats operation on InMemoryBroker.
§Arguments
&'a self- Shared reference to a'a self.&'a str- Shared reference to a'a str.&'a str- Shared reference to a'a str.
§Returns
BrokerFuture<'a, MqStats>- ABrokerFuture<'a, MqStats>value.
Auto Trait Implementations§
impl Forget for InMemoryBroker
impl Freeze for InMemoryBrokerwhere
*const ArcInner<InMemoryBrokerInner> is !null: Freeze,
PhantomData<ArcInner<InMemoryBrokerInner>>: Freeze,
impl Move for InMemoryBroker
impl RefUnwindSafe for InMemoryBrokerwhere
Atomic<usize>: RefUnwindSafe,
Atomic<u64>: RefUnwindSafe,
Atomic<u32>: RefUnwindSafe,
RwLock<HashMap<String, Arc<TopicBroker>, BuildHasherDefault<FnvHasher>>>: RefUnwindSafe,
OnceLock<Arc<TopicBroker>>: RefUnwindSafe,
RwLock<Vec<Arc<TopicBroker>>>: RefUnwindSafe,
impl Send for InMemoryBroker
impl Sync for InMemoryBroker
impl Unpin for InMemoryBroker
impl UnsafeUnpin for InMemoryBrokerwhere
*const ArcInner<InMemoryBrokerInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<InMemoryBrokerInner>>: UnsafeUnpin,
impl UnwindSafe for InMemoryBrokerwhere
Arc<InMemoryBrokerInner>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more