Skip to main content

Module clock

Module clock 

Source
Expand description

Causality clock used to stamp lock operations.

ADOPTS ash-time: when the ash-time feature is enabled, every acquire / renew / release is stamped with a Hybrid Logical Clock timestamp from ash_time::HlcClock. HLC timestamps are totally ordered and causally consistent, which makes them a natural fit for a coordination service: the stamp on a LockGuard lets callers reason about the causal order of lock events across nodes (e.g. for audit logs or debugging split-brain), independently of the fencing token.

Without the feature, a monotonic in-process counter provides the same interface (Stamp is still totally ordered locally) so downstream code never needs cfg guards. The counter’s physical field is left at 0 to make it obvious the value is not wall-clock-derived.

Structs§

Clock
A source of causally-ordered Stamps, shared across a client’s operations.
Stamp
A causally-ordered stamp for a lock operation.