Skip to main content
Table of Contents

Interface ISagaHandler

Namespace
Stratara.Sagas.Abstractions
Assembly
Stratara.Sagas.dll

Dispatcher that drives a single ISaga through a list of events, using the ISagaMethodInvoker to look up cached handler delegates.

public interface ISagaHandler
Extension Methods

Methods

GetRelevantEventTypeNames(ISaga)

Returns the assembly-qualified names of the saga's relevant event types — used for wire-level matching.

string[] GetRelevantEventTypeNames(ISaga saga)

Parameters

saga ISaga

The saga to inspect.

Returns

string[]

GetRelevantEventTypes(ISaga)

Returns the event types the saga declares HandleAsync methods for.

Type[] GetRelevantEventTypes(ISaga saga)

Parameters

saga ISaga

The saga to inspect.

Returns

Type[]

GetSagaName(ISaga)

Returns a stable display name for the saga (used in diagnostics + logging scopes).

string GetSagaName(ISaga saga)

Parameters

saga ISaga

The saga to inspect.

Returns

string

HandleAsync(ISaga, IReadOnlyList<IEvent>, CancellationToken)

Replays a list of events against the given saga instance, in order.

Task HandleAsync(ISaga saga, IReadOnlyList<IEvent> events, CancellationToken cancellationToken = default)

Parameters

saga ISaga

The saga instance to drive.

events IReadOnlyList<IEvent>

Events to dispatch (already filtered to relevant types by the manager).

cancellationToken CancellationToken

Cancellation token propagated to each handler invocation.

Returns

Task