MailboxSender

Trait MailboxSender 

Source
pub trait MailboxSender:
    Send
    + Sync
    + Any {
    // Required method
    fn post_unchecked(
        &self,
        envelope: MessageEnvelope,
        return_handle: PortHandle<Undeliverable<MessageEnvelope>>,
    );

    // Provided methods
    fn post(
        &self,
        envelope: MessageEnvelope,
        return_handle: PortHandle<Undeliverable<MessageEnvelope>>,
    ) { ... }
    fn flush<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

MailboxSenders can send messages through ports to mailboxes. It provides a unified interface for message delivery in the system.

Required Methods§

Source

fn post_unchecked( &self, envelope: MessageEnvelope, return_handle: PortHandle<Undeliverable<MessageEnvelope>>, )

Raw transport: no policy.

Provided Methods§

Source

fn post( &self, envelope: MessageEnvelope, return_handle: PortHandle<Undeliverable<MessageEnvelope>>, )

Apply hop semantics (TTL decrement; undeliverable on 0), then delegate to transport.

Source

fn flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait until all messages previously posted through this sender have been delivered (wire-acked) or confirmed undeliverable. The default implementation is a no-op, appropriate for senders whose post is synchronous (e.g. local in-process delivery).

Implementors§