pub struct IdempotencyEngine { /* private fields */ }Expand description
Idempotency engine — deduplication for step executions.
Implementations§
Source§impl IdempotencyEngine
impl IdempotencyEngine
pub fn new() -> Self
Sourcepub fn configure(
&mut self,
step_id: &str,
key_strategy: KeyStrategy,
window: IdempotencyWindow,
conflict_resolution: ConflictResolution,
) -> WorkflowResult<()>
pub fn configure( &mut self, step_id: &str, key_strategy: KeyStrategy, window: IdempotencyWindow, conflict_resolution: ConflictResolution, ) -> WorkflowResult<()>
Configure idempotency for a step.
Sourcepub fn compute_key(
&self,
step_id: &str,
workflow_id: &str,
input: &Value,
) -> WorkflowResult<String>
pub fn compute_key( &self, step_id: &str, workflow_id: &str, input: &Value, ) -> WorkflowResult<String>
Compute idempotency key for a step execution.
Sourcepub fn check(&self, key: &str) -> Option<&IdempotencyEntry>
pub fn check(&self, key: &str) -> Option<&IdempotencyEntry>
Check if a key was already processed.
Sourcepub fn store(
&mut self,
key: String,
step_id: &str,
execution_id: &str,
input_hash: &str,
output: Value,
) -> WorkflowResult<()>
pub fn store( &mut self, key: String, step_id: &str, execution_id: &str, input_hash: &str, output: Value, ) -> WorkflowResult<()>
Store execution result for deduplication.
Sourcepub fn record_hit(&mut self, step_id: &str)
pub fn record_hit(&mut self, step_id: &str)
Record a cache hit.
Sourcepub fn purge_expired(&mut self) -> usize
pub fn purge_expired(&mut self) -> usize
Purge expired entries.
Sourcepub fn report(&self) -> IdempotencyReport
pub fn report(&self) -> IdempotencyReport
Get deduplication report.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IdempotencyEngine
impl RefUnwindSafe for IdempotencyEngine
impl Send for IdempotencyEngine
impl Sync for IdempotencyEngine
impl Unpin for IdempotencyEngine
impl UnsafeUnpin for IdempotencyEngine
impl UnwindSafe for IdempotencyEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more