R
C

LamportClock

tested

A Lamport clock for one site: hands out monotonically increasing op ids and advances past observed remote ops so locally-generated ids stay causally later.

Signature

ts
class LamportClock

Properties

PropertyTypeDescription
valuereadonlynumber

Methods

tick

Generate the next op id for a local operation.

ts
tick(): OpId
ReturnsOpId
observe

Advance past a remote op so future local ticks are causally after it.

ts
observe(id: OpId): void
ParameterTypeDescription
idOpId