Skip to main content

WorkflowStore

Trait WorkflowStore 

Source
pub trait WorkflowStore: Send + Sync {
Show 13 methods // Required methods fn send_workflow_event<'a>( &'a self, command: &'a WorkflowEventCommand, ) -> ContractFuture<'a, WorkflowEventReceipt>; fn lookup_workflow_submission<'a>( &'a self, scope: &'a Scope, key: &'a str, ) -> ContractFuture<'a, Option<WorkflowSnapshot>>; fn replay_workflow_submission<'a>( &'a self, command: &'a SubmitCommand, ) -> ContractFuture<'a, Option<WorkflowSnapshot>>; fn accept_resolved_workflow<'a>( &'a self, command: &'a SubmitCommand, controller: &'a ProgramDescriptor, ) -> ContractFuture<'a, WorkflowSnapshot>; fn workflow_status<'a>( &'a self, scope: &'a Scope, id: &'a str, ) -> ContractFuture<'a, WorkflowSnapshot>; fn workflow_result<'a>( &'a self, scope: &'a Scope, id: &'a str, ) -> ContractFuture<'a, WorkflowResult>; fn activation_context<'a>( &'a self, owner: &'a LeaseOwner, ) -> ContractFuture<'a, WorkflowActivationContext>; fn record_local_result<'a>( &'a self, command: &'a LocalResultCommand, ) -> ContractFuture<'a, LocalResultReceipt>; fn claim_work(&self, limit: u32) -> ContractFuture<'_, Vec<WorkflowWork>>; fn apply_work<'a>( &'a self, work: &'a WorkflowWork, resolved: &'a [ResolvedWorkflowChild], ) -> ContractFuture<'a, WorkflowProgress>; fn retry_work<'a>( &'a self, work: &'a WorkflowWork, reason: &'a str, ) -> ContractFuture<'a, ()>; fn reject_work<'a>( &'a self, work: &'a WorkflowWork, error: &'a ApplicationError, ) -> ContractFuture<'a, ()>; fn cancel_workflow<'a>( &'a self, scope: &'a Scope, id: &'a str, ) -> ContractFuture<'a, WorkflowSnapshot>;
}
Expand description

Optional workflow persistence over the same transactional authority as the application’s task store. Implementations must atomically create tasks and dispatch obligations, append terminal completion work with task finalization, and apply checkpoints/child bindings/waits with their scheduling obligations. Separate, non-atomic task and workflow backends do not satisfy this port.

Child keys are workflow-scoped and retain their first normalized submission and pinned descriptor. Local keys are activation-scoped: exact records may be acknowledged again to their original accepting owner after expiry; a different attempt must hold current live authority. New records always require that authority and must be fenced against cancellation/continuation changes. Frozen activation inputs and revision never change as child events arrive. Work claims are bounded, leased, recoverable, and released before external program resolution; application rechecks ownership and persisted source state. Successful replies follow commit of every required write. Transport loss may leave a committed operation whose immutable identity must be reconciled.

Required Methods§

Source

fn send_workflow_event<'a>( &'a self, command: &'a WorkflowEventCommand, ) -> ContractFuture<'a, WorkflowEventReceipt>

Accept a directly addressed, one-shot event after committing its receipt. Exact source/ID/key/payload replays must reconcile before terminal checks. Implementations serialize acceptance and wait resolution under workflow authority; caller timestamps never decide event/deadline eligibility.

Source

fn lookup_workflow_submission<'a>( &'a self, scope: &'a Scope, key: &'a str, ) -> ContractFuture<'a, Option<WorkflowSnapshot>>

Source

fn replay_workflow_submission<'a>( &'a self, command: &'a SubmitCommand, ) -> ContractFuture<'a, Option<WorkflowSnapshot>>

Replays the original normalized submission before resolving packages.

Source

fn accept_resolved_workflow<'a>( &'a self, command: &'a SubmitCommand, controller: &'a ProgramDescriptor, ) -> ContractFuture<'a, WorkflowSnapshot>

Source

fn workflow_status<'a>( &'a self, scope: &'a Scope, id: &'a str, ) -> ContractFuture<'a, WorkflowSnapshot>

Source

fn workflow_result<'a>( &'a self, scope: &'a Scope, id: &'a str, ) -> ContractFuture<'a, WorkflowResult>

Source

fn activation_context<'a>( &'a self, owner: &'a LeaseOwner, ) -> ContractFuture<'a, WorkflowActivationContext>

Source

fn record_local_result<'a>( &'a self, command: &'a LocalResultCommand, ) -> ContractFuture<'a, LocalResultReceipt>

Source

fn claim_work(&self, limit: u32) -> ContractFuture<'_, Vec<WorkflowWork>>

Work leases own coordinator application, never worker execution. Claiming releases database locks before any external descriptor resolution.

Source

fn apply_work<'a>( &'a self, work: &'a WorkflowWork, resolved: &'a [ResolvedWorkflowChild], ) -> ContractFuture<'a, WorkflowProgress>

Source

fn retry_work<'a>( &'a self, work: &'a WorkflowWork, reason: &'a str, ) -> ContractFuture<'a, ()>

Source

fn reject_work<'a>( &'a self, work: &'a WorkflowWork, error: &'a ApplicationError, ) -> ContractFuture<'a, ()>

Persist permanent decision/application failure and drain owned children.

Source

fn cancel_workflow<'a>( &'a self, scope: &'a Scope, id: &'a str, ) -> ContractFuture<'a, WorkflowSnapshot>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§