Class ScheduleExecutionLease
Bearer authority identifying one admitted occurrence on one logical store.
public sealed record ScheduleExecutionLease : IEquatable<ScheduleExecutionLease>
- Inheritance
-
ScheduleExecutionLease
- Implements
- Inherited Members
- Extension Methods
Remarks
Providers validate the entire tuple against current stored ownership; constructing a token does not grant authority.
Constructors
ScheduleExecutionLease(Guid, Guid, Guid, DateTimeOffset, Guid)
Initializes a provider-issued ownership tuple.
public ScheduleExecutionLease(Guid storeId, Guid scheduleId, Guid generation, DateTimeOffset occurrenceUtc, Guid ownerToken)
Parameters
storeIdGuidLogical store identifier.
scheduleIdGuidSchedule identifier.
generationGuidAdministrative generation.
occurrenceUtcDateTimeOffsetOriginal admitted occurrence.
ownerTokenGuidUnique ownership token.
Properties
AdmissionAttempt
Gets the one-based count of admissions of this occurrence since its last committed settlement.
public required int AdmissionAttempt { get; init; }
Property Value
- int
1 on the first admission of an occurrence, incrementing on each subsequent admission of the same one.
Remarks
This is history, not authority, and it is deliberately excluded from the ownership tuple. Providers validate the other five members against current stored ownership; this one is reported alongside them so a caller can tell a first attempt from a repeated one, and changing it neither grants nor revokes anything.
It counts admissions, not handler invocations, and it resets only when a settlement is COMMITTED — never when a lease is released or lapses. That is what makes it bound the repeat: an occurrence whose settlement is refused is admitted again by the next poll, legitimately, because the fence makes a late write safe and a successor must be able to take over. Without a durable count the repeat is unbounded, and a count reset by release would never reach a bound at all.
Required rather than defaulted on purpose: a provider that omits it would otherwise report a first attempt forever, which no caller could distinguish from a healthy schedule.
Generation
Gets the administrative generation.
public Guid Generation { get; }
Property Value
OccurrenceUtc
Gets the original admitted occurrence.
public DateTimeOffset OccurrenceUtc { get; }
Property Value
OwnerToken
Gets the unique ownership token.
public Guid OwnerToken { get; }
Property Value
ScheduleId
Gets the schedule identifier.
public Guid ScheduleId { get; }
Property Value
StoreId
Gets the logical store identifier.
public Guid StoreId { get; }