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
TimeoutIdstringUnique identifier for this timeout instance.
SagaIdstringIdentifier of the saga that requested this timeout.
SagaTypestringAssembly-qualified type name of the saga for routing.
TimeoutTypestringAssembly-qualified type name of the timeout message type.
TimeoutDatabyte[]Serialized timeout data (MemoryPack format), or null for parameterless timeouts.
DueAtDateTimeOffsetUTC timestamp when this timeout should be delivered.
ScheduledAtDateTimeOffsetUTC timestamp when this timeout was originally scheduled.
Properties
DueAt
UTC timestamp when this timeout should be delivered.
public DateTimeOffset DueAt { get; init; }
Property Value
SagaId
Identifier of the saga that requested this timeout.
public string SagaId { get; init; }
Property Value
SagaType
Assembly-qualified type name of the saga for routing.
public string SagaType { get; init; }
Property Value
ScheduledAt
UTC timestamp when this timeout was originally scheduled.
public DateTimeOffset ScheduledAt { get; init; }
Property Value
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
TimeoutType
Assembly-qualified type name of the timeout message type.
public string TimeoutType { get; init; }