Skip to main content

AttributeNewerThanGuard

Namespace: Meshmakers.Octo.Runtime.Contracts

Optimistic-concurrency guard for conditional updates: the write applies only if the current persisted value at AttributeNewerThanGuard.AttributePath is missing, null, or less than or equal to AttributeNewerThanGuard.NewValue. Prevents older state from overwriting newer state when the order of arriving writes does not reflect the order in which they were generated — e.g. a late commit from a controller pod that is mid-shutdown racing with the write from the replacement pod that has already taken over.

public record AttributeNewerThanGuard : IEquatable<AttributeNewerThanGuard>

Inheritance ObjectAttributeNewerThanGuard
Implements IEquatable<AttributeNewerThanGuard>

Properties

AttributePath

Storage-layer dot-notation path to the timestamp field that gates the update. Examples: "attributes.communicationStateTimestamp" for a CK attribute, "rtChangedDateTime" for an entity-level field.

public string AttributePath { get; set; }

Property Value

String

NewValue

The timestamp the caller is about to write. The update only applies if the persisted value at AttributeNewerThanGuard.AttributePath is <= this.

public DateTime NewValue { get; set; }

Property Value

DateTime

Constructors

AttributeNewerThanGuard(String, DateTime)

Optimistic-concurrency guard for conditional updates: the write applies only if the current persisted value at AttributeNewerThanGuard.AttributePath is missing, null, or less than or equal to AttributeNewerThanGuard.NewValue. Prevents older state from overwriting newer state when the order of arriving writes does not reflect the order in which they were generated — e.g. a late commit from a controller pod that is mid-shutdown racing with the write from the replacement pod that has already taken over.

public AttributeNewerThanGuard(string AttributePath, DateTime NewValue)

Parameters

AttributePath String
Storage-layer dot-notation path to the timestamp field that gates the update. Examples: "attributes.communicationStateTimestamp" for a CK attribute, "rtChangedDateTime" for an entity-level field.

NewValue DateTime
The timestamp the caller is about to write. The update only applies if the persisted value at AttributeNewerThanGuard.AttributePath is <= this.