Skip to main content

Publisher

Trait Publisher 

Source
pub trait Publisher {
    // Required method
    fn publish<E>(
        &self,
        message: E,
    ) -> impl Future<Output = Result<(), Error>> + Send
       where E: Event + Clone + 'static;
}
Expand description

Re-exported so services only need to depend on arminius-lib-nats.

The message-bus Subscriber trait is intentionally not re-exported here to avoid clashing with the async_nats::Subscriber re-export above; reach it via arminius_lib_message_bus::Subscriber. Publishes events to the message bus.

Required Methods§

Source

fn publish<E>( &self, message: E, ) -> impl Future<Output = Result<(), Error>> + Send
where E: Event + Clone + 'static,

Publish an event to its subject.

§Errors

Returns Error::SendFailed if the message could not be published.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§