Skip to main content

Transport

Trait Transport 

Source
pub trait Transport<P>: Send + Sync
where P: Debug + Clone + Send + Sync,
{ // Required method fn publish<'life0, 'async_trait>( &'life0 self, event: Event<P>, ) -> Pin<Box<dyn Future<Output = Result<(), OutboxError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

Publishes a single Event to an external system.

Implementations are expected to be self-contained — everything the transport needs (connection pool, topic mapping, serializer) should live inside the impl so that the worker can keep its loop simple and focused on orchestration.

Implementations must be Send + Sync because the manager holds them behind an Arc and may drive them from arbitrary tokio tasks.

Required Methods§

Source

fn publish<'life0, 'async_trait>( &'life0 self, event: Event<P>, ) -> Pin<Box<dyn Future<Output = Result<(), OutboxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends an event to an external system.

Called per-event by OutboxProcessor. A successful return means the broker has accepted responsibility for the message; any retry semantics beyond that are an implementation detail of the concrete transport.

§Errors

Returns an OutboxError — usually BrokerError — if the broker call fails. The manager treats this as a per-event failure: the event is left in the processing state (and will be retried when its lock expires or, if the dlq feature is on, tracked via the DLQ heap) while sibling events in the same batch are still processed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§