Class SagaDefinition

Assembly: redb.Route.dll

Definition for a Saga step. Collects saga step entries and builds a
at route-build time.
Supports both callback-style (via ) and
fluent-scope-style (via / ).
Inherits the leaf DSL from .

public class SagaDefinition : RouteDefinitionBase<SagaDefinition>, IRouteDefinition, IProcessorDefinition, ISagaDefinition, IRouteScope

Inheritance

Implements

Inherited Members

Properties

CompletionCallback

Optional callback invoked after all steps complete successfully.

public Func<IExchange, CancellationToken, Task>? CompletionCallback { get; }

Entries

The collected saga step entries (forward action + optional compensation).

public IReadOnlyList<SagaStepEntry> Entries { get; }

Methods

CreateProcessor(IRouteContext)

Compile this node into a runtime processor.

public override IProcessor CreateProcessor(IRouteContext context)

End()

Closes this scope and returns the parent .

public IRouteDefinition End()

EndSaga()

Closes this saga scope and returns the parent route definition.

public IRouteDefinition EndSaga()

OnCompletion(Action<IExchange>)

Sets a callback invoked when all saga steps complete successfully.

public ISagaDefinition OnCompletion(Action<IExchange> callback)

OnCompletion(Func<IExchange, CancellationToken, Task>)

Sets an async callback invoked when all saga steps complete successfully.

public ISagaDefinition OnCompletion(Func<IExchange, CancellationToken, Task> callback)

OnSagaCompletion(Action<IExchange>)

Sets the saga completion callback (synchronous).

public SagaDefinition OnSagaCompletion(Action<IExchange> callback)

OnSagaCompletion(Func<IExchange, CancellationToken, Task>)

Sets the saga completion callback (asynchronous).

public SagaDefinition OnSagaCompletion(Func<IExchange, CancellationToken, Task> callback)

SagaStep(Action<IExchange>, Action<IExchange>)

Adds a synchronous saga step with both action and compensation.

public SagaDefinition SagaStep(Action<IExchange> action, Action<IExchange> compensate)

SagaStep(Action<IExchange>)

Adds a synchronous saga step with no compensation.

public SagaDefinition SagaStep(Action<IExchange> action)

SagaStep(Func<IExchange, CancellationToken, Task>, Func<IExchange, CancellationToken, Task>)

Adds an asynchronous saga step with both action and compensation.

public SagaDefinition SagaStep(Func<IExchange, CancellationToken, Task> action, Func<IExchange, CancellationToken, Task> compensate)

SagaStep(Func<IExchange, CancellationToken, Task>)

Adds an asynchronous saga step with no compensation.

public SagaDefinition SagaStep(Func<IExchange, CancellationToken, Task> action)

Step(Action<IExchange>, Action<IExchange>)

Adds a synchronous saga step with compensation.

public ISagaDefinition Step(Action<IExchange> action, Action<IExchange> compensate)

Step(Action<IExchange>)

Adds a forward-only saga step (no compensation on rollback).

public ISagaDefinition Step(Action<IExchange> action)

Step(Func<IExchange, CancellationToken, Task>, Func<IExchange, CancellationToken, Task>)

Adds an async saga step with compensation.

public ISagaDefinition Step(Func<IExchange, CancellationToken, Task> action, Func<IExchange, CancellationToken, Task> compensate)

Step(Func<IExchange, CancellationToken, Task>)

Adds an async forward-only saga step (no compensation on rollback).

public ISagaDefinition Step(Func<IExchange, CancellationToken, Task> action)

Step(IProcessor, IProcessor?)

Adds a saga step from processor instances — the seam declarative forms use (Route-XML

public ISagaDefinition Step(IProcessor action, IProcessor? compensate = null)