LamportClock class
A per-replica Lamport clock that mints Dots for local edits.
observe folds a counter seen on incoming content into the local clock so that the next minted dot strictly dominates it. This gives, for free, the "local edits causally dominate observed content" property that a separate HLC-witness step had to enforce out-of-band: an edit authored against pulled content always sorts after that content.
Constructors
- LamportClock(String replica, [int _counter = 0])
-
Creates a clock for
replica, optionally resuming from a prior counter.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- replica → String
-
Stable identifier of this replica; stamped into every minted Dot.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → int
-
Current high-water mark. The next tick returns
value + 1.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observe(
int counter) → void -
Raise the clock so future dots dominate an observed
counter(Lamport receive rule). -
observeAll(
Iterable< Dot> dots) → void - Convenience: observe every dot of an existing element set.
-
tick(
) → Dot - Mint the next dot for a local event.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited