pub struct MessageQueue { /* private fields */ }Expand description
Message queue for each endpoint
Implementations§
Source§impl MessageQueue
impl MessageQueue
Sourcepub fn add_receiver(&mut self, pid: ProcessId)
pub fn add_receiver(&mut self, pid: ProcessId)
Add a waiting receiver
Sourcepub fn get_receiver(&mut self) -> Option<ProcessId>
pub fn get_receiver(&mut self) -> Option<ProcessId>
Get a waiting receiver
Sourcepub fn add_sender(&mut self, pid: ProcessId, msg: Message)
pub fn add_sender(&mut self, pid: ProcessId, msg: Message)
Add a waiting sender
Sourcepub fn process_waiting_senders(&mut self) -> Vec<ProcessId>
pub fn process_waiting_senders(&mut self) -> Vec<ProcessId>
Process waiting senders (when space becomes available)
Sourcepub fn has_messages(&self) -> bool
pub fn has_messages(&self) -> bool
Check if queue has messages
Sourcepub fn has_waiting_receivers(&self) -> bool
pub fn has_waiting_receivers(&self) -> bool
Check if there are waiting receivers