Class OccurrenceContext
- Namespace
- Cratis.Chronicle.Occurrences
- Assembly
- Cratis.Chronicle.dll
Describes one delivery attempt. Due and recorded times come from the kernel clock, not the execution start.
public record OccurrenceContext : IEquatable<OccurrenceContext>
- Inheritance
-
OccurrenceContext
- Implements
- Inherited Members
- Extension Methods
Constructors
OccurrenceContext(OccurrenceContext)
protected OccurrenceContext(OccurrenceContext original)
Parameters
originalOccurrenceContext
OccurrenceContext(OccurrenceId, TriggerId, OccurrenceKind, DateTimeOffset?, DateTimeOffset, ScheduleRevision?, int, LeaseToken)
Describes one delivery attempt. Due and recorded times come from the kernel clock, not the execution start.
public OccurrenceContext(OccurrenceId Id, TriggerId Trigger, OccurrenceKind Kind, DateTimeOffset? DueAt, DateTimeOffset RecordedAt, ScheduleRevision? Revision, int Attempt, LeaseToken Lease)
Parameters
IdOccurrenceIdThe stable occurrence identity.
TriggerTriggerIdThe registered trigger.
KindOccurrenceKindThe occurrence source.
DueAtDateTimeOffset?The due instant for a scheduled occurrence.
RecordedAtDateTimeOffsetThe durable ingress instant.
RevisionScheduleRevisionThe schedule definition revision, when scheduled.
AttemptintThe delivery attempt number.
LeaseLeaseTokenThe current fenced lease.
Properties
Attempt
The delivery attempt number.
public int Attempt { get; init; }
Property Value
DueAt
The due instant for a scheduled occurrence.
public DateTimeOffset? DueAt { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
Id
The stable occurrence identity.
public OccurrenceId Id { get; init; }
Property Value
Kind
The occurrence source.
public OccurrenceKind Kind { get; init; }
Property Value
Lease
The current fenced lease.
public LeaseToken Lease { get; init; }
Property Value
Namespace
Gets the delivery namespace, or null for application-scoped lifecycle work. AllNamespaces handlers use this namespace when selecting the event store for their effects.
public EventStoreNamespaceName? Namespace { get; init; }
Property Value
RecordedAt
The durable ingress instant.
public DateTimeOffset RecordedAt { get; init; }
Property Value
Revision
The schedule definition revision, when scheduled.
public ScheduleRevision? Revision { get; init; }
Property Value
Trigger
The registered trigger.
public TriggerId Trigger { get; init; }
Property Value
Methods
Deconstruct(out OccurrenceId, out TriggerId, out OccurrenceKind, out DateTimeOffset?, out DateTimeOffset, out ScheduleRevision?, out int, out LeaseToken)
public void Deconstruct(out OccurrenceId Id, out TriggerId Trigger, out OccurrenceKind Kind, out DateTimeOffset? DueAt, out DateTimeOffset RecordedAt, out ScheduleRevision? Revision, out int Attempt, out LeaseToken Lease)
Parameters
IdOccurrenceIdTriggerTriggerIdKindOccurrenceKindDueAtDateTimeOffset?RecordedAtDateTimeOffsetRevisionScheduleRevisionAttemptintLeaseLeaseToken
EffectKey(EffectName)
Identifies an effect across redelivery. Pass its Value to external idempotent endpoints.
public EffectKey EffectKey(EffectName name)
Parameters
nameEffectNameThe stable name of the effect within this occurrence.
Returns
- EffectKey
The attempt-independent effect identity with the current writing lease.
Equals(OccurrenceContext?)
public virtual bool Equals(OccurrenceContext? other)
Parameters
otherOccurrenceContext
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(OccurrenceContext?, OccurrenceContext?)
public static bool operator ==(OccurrenceContext? left, OccurrenceContext? right)
Parameters
leftOccurrenceContextrightOccurrenceContext
Returns
operator !=(OccurrenceContext?, OccurrenceContext?)
public static bool operator !=(OccurrenceContext? left, OccurrenceContext? right)
Parameters
leftOccurrenceContextrightOccurrenceContext