Table of Contents

Class SagaTimeout

Namespace
Excalibur.Saga.Abstractions
Assembly
Excalibur.Saga.dll

Represents a scheduled timeout for a saga instance. Timeouts are used to trigger actions after a specified delay when a saga is waiting for external events.

public sealed record SagaTimeout : IEquatable<SagaTimeout>
Inheritance
SagaTimeout
Implements
Inherited Members

Constructors

SagaTimeout(string, string, string, string, byte[]?, DateTimeOffset, DateTimeOffset)

Represents a scheduled timeout for a saga instance. Timeouts are used to trigger actions after a specified delay when a saga is waiting for external events.

public SagaTimeout(string TimeoutId, string SagaId, string SagaType, string TimeoutType, byte[]? TimeoutData, DateTimeOffset DueAt, DateTimeOffset ScheduledAt)

Parameters

TimeoutId string

Unique identifier for this timeout instance.

SagaId string

Identifier of the saga that requested this timeout.

SagaType string

Assembly-qualified type name of the saga for routing.

TimeoutType string

Assembly-qualified type name of the timeout message type.

TimeoutData byte[]

Serialized timeout data (MemoryPack format), or null for parameterless timeouts.

DueAt DateTimeOffset

UTC timestamp when this timeout should be delivered.

ScheduledAt DateTimeOffset

UTC timestamp when this timeout was originally scheduled.

Properties

DueAt

UTC timestamp when this timeout should be delivered.

public DateTimeOffset DueAt { get; init; }

Property Value

DateTimeOffset

SagaId

Identifier of the saga that requested this timeout.

public string SagaId { get; init; }

Property Value

string

SagaType

Assembly-qualified type name of the saga for routing.

public string SagaType { get; init; }

Property Value

string

ScheduledAt

UTC timestamp when this timeout was originally scheduled.

public DateTimeOffset ScheduledAt { get; init; }

Property Value

DateTimeOffset

TenantId

Gets the tenant that owns the saga this timeout belongs to, as persisted on the timeout row — or the reserved untenanted term for a saga that is not tenant-scoped. Never null.

public string TenantId { get; init; }

Property Value

string

The owning tenant term, or the reserved untenanted term.

Remarks

Populated by the store when a timeout is read back; ignored when one is scheduled. A caller scheduling a timeout does not supply it — the store stamps the row from the ambient tenant, the same authority every other store in this framework uses, so a scheduled timeout cannot claim a tenant its caller had not established.

It is carried back on the read because timeout delivery is a background, estate-wide operation: the delivery loop leases due timeouts across every tenant in one batch — it cannot itself be tenant-scoped without claiming nothing — and must then re-establish each timeout's own tenant before dispatching it, so the saga the handler loads is the saga that scheduled it. A timeout dispatched without its tenant re-established resolves a different partition than the one the saga was saved under, finds nothing, and fails silently.

TimeoutData

Serialized timeout data (MemoryPack format), or null for parameterless timeouts.

public byte[]? TimeoutData { get; init; }

Property Value

byte[]

TimeoutId

Unique identifier for this timeout instance.

public string TimeoutId { get; init; }

Property Value

string

TimeoutType

Assembly-qualified type name of the timeout message type.

public string TimeoutType { get; init; }

Property Value

string