Class StepLease
- Namespace
- FlowOrchestrator.Core.Storage
- Assembly
- FlowOrchestrator.Core.dll
An execution claim on one step that this process holds for a bounded time, identified by its fence.
public sealed record StepLease : IEquatable<StepLease>
- Inheritance
-
StepLease
- Implements
- Inherited Members
Remarks
A lease replaces the 1.x claim that never expired: a worker killed mid-handler left its claim for ever, every redelivery of the step exited on "claimed by another worker", and the run stayed Running until an operator intervened (RFC 2.0 C1). The lease expires unless the owning process renews it, so once its owner is gone another delivery takes the step over (TryAcquireStepLeaseAsync(Guid, string, string, TimeSpan)).
Taking over is allowed only while the step has not reached a terminal status: a completed step keeps its claim for good, which is what keeps execution once-only under at-least-once delivery.
Constructors
StepLease(Guid, string, long)
An execution claim on one step that this process holds for a bounded time, identified by its fence.
public StepLease(Guid RunId, string StepKey, long Fence)
Parameters
RunIdGuidThe run owning the step.
StepKeystringThe claimed step.
FencelongMonotonic token of this acquisition:
1for the first claim of the step, raised by one every time an expired lease is taken over. Every write made on the lease's behalf is accepted only while the stored fence still equals this value, so a worker whose lease was taken over cannot overwrite the new owner's work.
Remarks
A lease replaces the 1.x claim that never expired: a worker killed mid-handler left its claim for ever, every redelivery of the step exited on "claimed by another worker", and the run stayed Running until an operator intervened (RFC 2.0 C1). The lease expires unless the owning process renews it, so once its owner is gone another delivery takes the step over (TryAcquireStepLeaseAsync(Guid, string, string, TimeSpan)).
Taking over is allowed only while the step has not reached a terminal status: a completed step keeps its claim for good, which is what keeps execution once-only under at-least-once delivery.
Properties
Fence
Monotonic token of this acquisition: 1 for the first claim of the step, raised by one every time an
expired lease is taken over. Every write made on the lease's behalf is accepted only while the stored fence
still equals this value, so a worker whose lease was taken over cannot overwrite the new owner's work.
public long Fence { get; init; }
Property Value
RunId
The run owning the step.
public Guid RunId { get; init; }
Property Value
StepKey
The claimed step.
public string StepKey { get; init; }