Skip to main content
Table of Contents

Interface ISagaProcess

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

The untyped face of SagaProcess<TState> the runtime works with.

public interface ISagaProcess : ISaga
Extension Methods

Properties

StateType

The state type, an aggregate of the process's own.

Type StateType { get; }

Property Value

Type

Methods

CorrelationOf(IEvent)

The correlation the fact belongs to; one process instance per correlation.

Guid CorrelationOf(IEvent @event)

Parameters

event IEvent

A fact the process handles.

Returns

Guid

The correlation id of the process instance the fact advances.

HandleAsync(object, IEvent, ISagaProcessContext, CancellationToken)

Advances the process.

Task HandleAsync(object state, IEvent @event, ISagaProcessContext context, CancellationToken cancellationToken)

Parameters

state object

The folded state.

event IEvent

The fact.

context ISagaProcessContext

Where emitted events and timeouts go.

cancellationToken CancellationToken

Propagated to the handling.

Returns

Task

A task that completes when the step has been decided.

Handles(IEvent)

Whether the process starts or advances on this fact.

bool Handles(IEvent @event)

Parameters

event IEvent

A fact from the store.

Returns

bool

true when the process handles the fact.

OnTimeoutAsync(object, string, ISagaProcessContext, CancellationToken)

A scheduled timeout is due.

Task OnTimeoutAsync(object state, string purpose, ISagaProcessContext context, CancellationToken cancellationToken)

Parameters

state object

The folded state.

purpose string

The purpose the timeout was scheduled with.

context ISagaProcessContext

Where emitted events and timeouts go.

cancellationToken CancellationToken

Propagated to the handling.

Returns

Task

A task that completes when the step has been decided.