Skip to main content

OutboxStore

Trait OutboxStore 

Source
pub trait OutboxStore: Send + Sync {
    // Required methods
    fn enqueue<'life0, 'async_trait>(
        &'life0 self,
        event: EventInput,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn claim<'life0, 'async_trait>(
        &'life0 self,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<OutboxEntry>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn ack<'life0, 'async_trait>(
        &'life0 self,
        ids: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn release<'life0, 'async_trait>(
        &'life0 self,
        ids: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Where a queued Events::emit keeps events until the worker sends them.

A store must be safe to call from the worker and from a queued emit concurrently.

Required Methods§

Source

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

Store event at the tail; fail with Error::Outbox code outbox_full when the store is full.

Source

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

Up to limit oldest entries, FIFO. A claimed entry is not returned by another claim until it is released (Redis: until it goes stale). claim(0) is empty.

Source

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

Delete the entries permanently.

Source

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

Make the entries eligible for a later claim; timing is store-specific.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§