[][src]Trait wascc_actor::MessageBroker

pub trait MessageBroker {
    fn publish(
        &self,
        subject: &str,
        reply_to: Option<&str>,
        payload: &[u8]
    ) -> Result<()>;
fn request(
        &self,
        subject: &str,
        payload: &[u8],
        timeout_ms: u64
    ) -> Result<Vec<u8>>; }

Represents an abstraction around a client consuming a message broker provided by the host

Required methods

fn publish(
    &self,
    subject: &str,
    reply_to: Option<&str>,
    payload: &[u8]
) -> Result<()>

Publishes a new message on the given subject with an optional reply-to

fn request(
    &self,
    subject: &str,
    payload: &[u8],
    timeout_ms: u64
) -> Result<Vec<u8>>

Publishes a message on the given subject and awaits a reply on an inbox subject

Loading content...

Implementors

impl MessageBroker for DefaultMessageBroker[src]

Loading content...