Skip to main content

CommandDedupPort

Trait CommandDedupPort 

Source
pub trait CommandDedupPort: Send + Sync {
    // Required methods
    fn first_seen<'life0, 'life1, 'async_trait>(
        &'life0 self,
        command_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn forget_seen<'life0, 'life1, 'async_trait>(
        &'life0 self,
        command_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn first_seen<'life0, 'life1, 'async_trait>( &'life0 self, command_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns true when the command ID is seen for the first time. Returns false when the command ID was already processed/reserved.

Source

fn forget_seen<'life0, 'life1, 'async_trait>( &'life0 self, command_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove command ID reservation/marker. Used as compensation when command execution fails.

Implementors§