Vector clock implementation in js. Vector clocks can be used to generate partial ordering of events in a distributed system.
Implements the asynchronous algorithm described in Timestamps in Message-Passing Systems That Preserve the Partial Ordering.
$ npm install vclock
Creates a new Clock
. id
is used as a key in the clock hash.
Increment the clock.
Get the current local clock value for clock id
.
id
defaults to the clocks id
.
Unknown clocks have value 0
.
Update the local clock with values from clock
.
MIT