Skip to main content

Module hlc

Module hlc 

Source
Expand description

The hybrid logical clock that orders a collection’s records (SPEC_USER_DATA_SYNC_LAYER §3.2): wall milliseconds, a counter for changes in the same millisecond, and the machine that made the change, so any two versions are totally ordered. A version far ahead of the receiver’s own clock is refused, so a machine with a wrong clock cannot win every merge.

Structs§

Clock
One machine’s clock for one collection.
SkewRefused
A version was too far ahead of this machine’s clock.
Version
A record’s version: ordered by wall time, then counter, then machine.

Constants§

MAX_SKEW_MS
How far ahead of the receiver’s clock a version may be before it is refused.