Skip to main content

DurableOutbox

Trait DurableOutbox 

Source
pub trait DurableOutbox: Send + Sync {
    // Required methods
    fn enqueue<'life0, 'async_trait>(
        &'life0 self,
        item: NewOutboxItem,
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn claim<'life0, 'life1, 'async_trait>(
        &'life0 self,
        worker_id: &'life1 str,
        lease_secs: i64,
        batch: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<OutboxItem>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn mark_sent<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        lease_version: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn retry<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        lease_version: i64,
        error: &'life2 str,
        delay_secs: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Lease-fenced durable queue between producers and transport senders.

Required Methods§

Source

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

Persist a notification and return its id.

Source

fn claim<'life0, 'life1, 'async_trait>( &'life0 self, worker_id: &'life1 str, lease_secs: i64, batch: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<OutboxItem>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Claim up to batch due items for worker_id with a lease of lease_secs.

Source

fn mark_sent<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, lease_version: i64, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark a claimed item delivered; fails when the lease was lost.

Source

fn retry<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, lease_version: i64, error: &'life2 str, delay_secs: i64, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Release a claimed item for a later attempt with the given error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§