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

original OccurrenceContext

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

Id OccurrenceId

The stable occurrence identity.

Trigger TriggerId

The registered trigger.

Kind OccurrenceKind

The occurrence source.

DueAt DateTimeOffset?

The due instant for a scheduled occurrence.

RecordedAt DateTimeOffset

The durable ingress instant.

Revision ScheduleRevision

The schedule definition revision, when scheduled.

Attempt int

The delivery attempt number.

Lease LeaseToken

The current fenced lease.

Properties

Attempt

The delivery attempt number.

public int Attempt { get; init; }

Property Value

int

DueAt

The due instant for a scheduled occurrence.

public DateTimeOffset? DueAt { get; init; }

Property Value

DateTimeOffset?

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Id

The stable occurrence identity.

public OccurrenceId Id { get; init; }

Property Value

OccurrenceId

Kind

The occurrence source.

public OccurrenceKind Kind { get; init; }

Property Value

OccurrenceKind

Lease

The current fenced lease.

public LeaseToken Lease { get; init; }

Property Value

LeaseToken

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

EventStoreNamespaceName

RecordedAt

The durable ingress instant.

public DateTimeOffset RecordedAt { get; init; }

Property Value

DateTimeOffset

Revision

The schedule definition revision, when scheduled.

public ScheduleRevision? Revision { get; init; }

Property Value

ScheduleRevision

Trigger

The registered trigger.

public TriggerId Trigger { get; init; }

Property Value

TriggerId

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

Id OccurrenceId
Trigger TriggerId
Kind OccurrenceKind
DueAt DateTimeOffset?
RecordedAt DateTimeOffset
Revision ScheduleRevision
Attempt int
Lease LeaseToken

EffectKey(EffectName)

Identifies an effect across redelivery. Pass its Value to external idempotent endpoints.

public EffectKey EffectKey(EffectName name)

Parameters

name EffectName

The 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

other OccurrenceContext

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(OccurrenceContext?, OccurrenceContext?)

public static bool operator ==(OccurrenceContext? left, OccurrenceContext? right)

Parameters

left OccurrenceContext
right OccurrenceContext

Returns

bool

operator !=(OccurrenceContext?, OccurrenceContext?)

public static bool operator !=(OccurrenceContext? left, OccurrenceContext? right)

Parameters

left OccurrenceContext
right OccurrenceContext

Returns

bool