Interface IClockVector

Interface which represents a local clock and a list of remote clocks.

interface IClockVector {
    peers: Map<number, ITimestampStruct>;
    sid: number;
    time: number;
    clone(): IClockVector;
    fork(sessionId): IClockVector;
    observe(ts, span): void;
    tick(cycles): ITimestampStruct;
    toString(tab?): string;
}

Hierarchy (view full)

Implemented by

Properties

peers: Map<number, ITimestampStruct>

Mapping of session IDs to logical timestamps.

sid: number

Session ID (or actor ID, site ID, process ID, etc.), a random identifier randomly assigned to each editing session.

time: number

Logical time (or sequence number, tick, etc.), a monotonically increasing integer, starting from 0. It does not produce gaps on local machine, but it can produce gaps when merged with other clocks.

Needs to be mutable in vector clock. Other than that, it should be treated as immutable.

Methods

  • Returns a textual human-readable representation, useful for debugging.

    Parameters

    • Optional tab: string

    Returns string