pub trait IdempotencyStore: Send + Sync {
// Required methods
fn try_claim<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 MessageId,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<ClaimOutcome, BusError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn mark_done<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<(), BusError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn release<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<(), BusError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Backend-agnostic idempotency store for deduplicating handler executions.
Implementations must use atomic operations to remain safe under concurrent delivery.
Required Methods§
Sourcefn try_claim<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 MessageId,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<ClaimOutcome, BusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn try_claim<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 MessageId,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<ClaimOutcome, BusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
State-aware claim. Atomically inserts the key in pending state if
absent, otherwise reports the existing state.