Skip to content

madbence/node-vclock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vclock Build Status

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.

Install

Install the package with npm:

$ npm install vclock

API

new Clock(id)

Creates a new Clock. id is used as a key in the clock hash.

.tick()

Increment the clock.

.get([id])

Get the current local clock value for clock id. id defaults to the clocks id.

Unknown clocks have value 0.

.update(clock)

Update the local clock with values from clock.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published