VectorClock
Defined in: src/persistence/replicated/VectorClock.ts:26
Methods
Section titled “Methods”compareTo()
Section titled “compareTo()”compareTo(
other):VectorClockOrder
Defined in: src/persistence/replicated/VectorClock.ts:68
Compare with another clock.
Returns:
'before'— every component ofthisis<= otherand at least one is strictly less.'after'— every component ofthisis>= otherand at least one is strictly greater.'equal'— all components match.'concurrent'— neither dominates.
Parameters
Section titled “Parameters”VectorClock
Returns
Section titled “Returns”get(
replica):number
Defined in: src/persistence/replicated/VectorClock.ts:38
Get the value for replica; missing entries are 0.
Parameters
Section titled “Parameters”replica
Section titled “replica”string
Returns
Section titled “Returns”number
happensBefore()
Section titled “happensBefore()”happensBefore(
other):boolean
Defined in: src/persistence/replicated/VectorClock.ts:85
True iff this strictly happens-before other.
Parameters
Section titled “Parameters”VectorClock
Returns
Section titled “Returns”boolean
isConcurrentWith()
Section titled “isConcurrentWith()”isConcurrentWith(
other):boolean
Defined in: src/persistence/replicated/VectorClock.ts:88
True iff this and other are concurrent (neither dominates).
Parameters
Section titled “Parameters”VectorClock
Returns
Section titled “Returns”boolean
merge()
Section titled “merge()”merge(
other):VectorClock
Defined in: src/persistence/replicated/VectorClock.ts:48
Component-wise max — used after observing a remote event.
Parameters
Section titled “Parameters”VectorClock
Returns
Section titled “Returns”VectorClock
tick()
Section titled “tick()”tick(
replica):VectorClock
Defined in: src/persistence/replicated/VectorClock.ts:41
Bump replica’s component by 1 — typically called when persisting.
Parameters
Section titled “Parameters”replica
Section titled “replica”string
Returns
Section titled “Returns”VectorClock
toJSON()
Section titled “toJSON()”toJSON():
VectorClockData
Defined in: src/persistence/replicated/VectorClock.ts:90
Returns
Section titled “Returns”toString()
Section titled “toString()”toString():
string
Defined in: src/persistence/replicated/VectorClock.ts:96
Returns
Section titled “Returns”string
empty()
Section titled “empty()”
staticempty():VectorClock
Defined in: src/persistence/replicated/VectorClock.ts:30
All components zero.
Returns
Section titled “Returns”VectorClock
fromData()
Section titled “fromData()”
staticfromData(data):VectorClock
Defined in: src/persistence/replicated/VectorClock.ts:33
Build from an object literal — omitted entries are treated as 0.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”VectorClock