ReadonlypeersA stub for other peers. Not used in the server clock.
ReadonlysidSession ID (or actor ID, site ID, process ID, etc.), a random identifier randomly assigned to each editing session.
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.
Returns a deep copy of the current vector clock with the same session ID.
A new vector clock, which is a clone of the current vector clock.
Returns a deep copy of the current vector clock with a different session ID.
A new vector clock, which is a fork of the current vector clock.
Returns the gap between the observed timestamp and the provided timestamp.
Checks if the timestamp "has been observed" by this causal context.
Advances local time every time we see any timestamp with higher time value. This is an idempotent method which can be called every time a new timestamp is observed, it advances the local time only if the observed timestamp is greater than the current local time.
Length of the time span.
Returns a new timestamp, which is the current clock value, and advances the clock by a number of cycles.
Number of cycles to advance the clock.
A new timestamp, which is the current clock value.
Returns a human-readable string representation of the clock vector.
String to use for indentation.
Human-readable string representation of the clock vector.
Serializes the clock vector to a binary format.
This clock serialized as a version vector.
StaticfromCreate a new clock out of the version vector. The first element is the local clock, and the rest are the clocks of other peers.
Staticfrom
Implements a clock vector with a fixed session ID. The server clock is used when the CRDT is powered by a central server.