Skip to content

VectorClock

Defined in: src/persistence/replicated/VectorClock.ts:26

compareTo(other): VectorClockOrder

Defined in: src/persistence/replicated/VectorClock.ts:68

Compare with another clock.

Returns:

  • 'before' — every component of this is <= other and at least one is strictly less.
  • 'after' — every component of this is >= other and at least one is strictly greater.
  • 'equal' — all components match.
  • 'concurrent' — neither dominates.

VectorClock

VectorClockOrder


get(replica): number

Defined in: src/persistence/replicated/VectorClock.ts:38

Get the value for replica; missing entries are 0.

string

number


happensBefore(other): boolean

Defined in: src/persistence/replicated/VectorClock.ts:85

True iff this strictly happens-before other.

VectorClock

boolean


isConcurrentWith(other): boolean

Defined in: src/persistence/replicated/VectorClock.ts:88

True iff this and other are concurrent (neither dominates).

VectorClock

boolean


merge(other): VectorClock

Defined in: src/persistence/replicated/VectorClock.ts:48

Component-wise max — used after observing a remote event.

VectorClock

VectorClock


tick(replica): VectorClock

Defined in: src/persistence/replicated/VectorClock.ts:41

Bump replica’s component by 1 — typically called when persisting.

string

VectorClock


toJSON(): VectorClockData

Defined in: src/persistence/replicated/VectorClock.ts:90

VectorClockData


toString(): string

Defined in: src/persistence/replicated/VectorClock.ts:96

string


static empty(): VectorClock

Defined in: src/persistence/replicated/VectorClock.ts:30

All components zero.

VectorClock


static fromData(data): VectorClock

Defined in: src/persistence/replicated/VectorClock.ts:33

Build from an object literal — omitted entries are treated as 0.

VectorClockData

VectorClock