Skip to content

Class DurableExecutionStrategy

Namespace: Cephalon.Behaviors.Patterns.Strategies
Assembly: Cephalon.Behaviors.Patterns.dll

Executes replayable durable workflows by rebuilding state from an event-store stream, invoking the workflow step, and appending the emitted domain events with optimistic concurrency.

public sealed class DurableExecutionStrategy : IBehaviorExecutionStrategy

objectDurableExecutionStrategy

IBehaviorExecutionStrategy

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

DurableExecutionStrategy(IDurableExecutionRuntimeStateCatalog?)

Section titled “ DurableExecutionStrategy(IDurableExecutionRuntimeStateCatalog?)”

Creates a durable execution strategy.

public DurableExecutionStrategy(IDurableExecutionRuntimeStateCatalog? runtimeStateCatalog = null)

runtimeStateCatalog IDurableExecutionRuntimeStateCatalog?

An optional runtime-state catalog that can also accept operator-facing observations for active durable streams.

Gets the pattern identifier handled by this strategy.

public string Pattern { get; }

string

ExecuteAsync(BehaviorExecutionContext, CancellationToken)

Section titled “ ExecuteAsync(BehaviorExecutionContext, CancellationToken)”

Replays the durable workflow stream, executes one workflow step, validates the returned domain events, and appends them through .

public Task<BehaviorExecutionResult> ExecuteAsync(BehaviorExecutionContext context, CancellationToken ct = default)

context BehaviorExecutionContext

The execution context for this invocation.

ct CancellationToken

A token that cancels the execution.

Task<BehaviorExecutionResult>

A result with HTTP 200 when local output exists, HTTP 202 when durable continuation work or pending timer/signal coordination remains without local output, or HTTP 204 when no local output remains and the step completed without follow-up work.

InvalidOperationException

Thrown when durable execution is selected for a behavior that does not implement IDurableExecution<TInput, TState, TOutput>, when the behavior context does not carry an event store, or when the returned events do not match the expected stream identity or version sequence.