pub struct CellMessageBus { /* private fields */ }Expand description
Cell Message Bus
Provides publish/subscribe messaging within a squad with:
- Message ordering via sequence numbers
- Reliable delivery with retransmission
- Priority-based delivery
- Message expiration
Implementations§
Source§impl CellMessageBus
impl CellMessageBus
Sourcepub fn subscribe(&self, handler: MessageHandler) -> Result<()>
pub fn subscribe(&self, handler: MessageHandler) -> Result<()>
Subscribe to squad messages
Sourcepub fn publish(&self, payload: CellMessageType) -> Result<SequenceNumber>
pub fn publish(&self, payload: CellMessageType) -> Result<SequenceNumber>
Publish a message to the squad
Sourcepub fn deliver(&self, message: &CellMessage) -> Result<()>
pub fn deliver(&self, message: &CellMessage) -> Result<()>
Deliver a received message to subscribers
Sourcepub fn acknowledge(&self, message_seq: SequenceNumber) -> Result<()>
pub fn acknowledge(&self, message_seq: SequenceNumber) -> Result<()>
Acknowledge a received message
Sourcepub fn process_retransmissions(&self) -> Result<Vec<CellMessage>>
pub fn process_retransmissions(&self) -> Result<Vec<CellMessage>>
Process retransmissions for unacknowledged messages
Sourcepub fn get_pending_messages(&self) -> Result<Vec<CellMessage>>
pub fn get_pending_messages(&self) -> Result<Vec<CellMessage>>
Get pending outbound messages
Sourcepub fn stats(&self) -> MessageBusStats
pub fn stats(&self) -> MessageBusStats
Get statistics
Auto Trait Implementations§
impl Freeze for CellMessageBus
impl RefUnwindSafe for CellMessageBus
impl Send for CellMessageBus
impl Sync for CellMessageBus
impl Unpin for CellMessageBus
impl UnsafeUnpin for CellMessageBus
impl UnwindSafe for CellMessageBus
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more