CausalTrack
Keywords: Causality tracking, version vectors, interval version vectors, version vector with exceptions
This project provides structures for causality tracking. The first one is the well-known version vector (VV) which allows to characterise on-the-fly causality between events.
The second one is the interval version vector (IVV) [1] which provides a tracking of semantically dependent events. Therefore, independent events are non-blocking to each other.
The next one is a version vector with exceptions (VVwE) [2] which provides the same features than the IVV. Nevertheless, it does not use the same underlying structure.
We provide another version of the VVwE called perishing version vector with exceptions (PVVwE) where exceptions disappear over time by design. Such vector is useful in practice since messages are expected to arrive within defined range of time. Also, the site identifiers that are not used anymore tend to disappear.
Installation
$ npm install causaltrack
Usage
The module has been browserified and uglified. To include CausalTrack within your browser, put the following line in your html:
Then, whether you use the browserified version or nodejs:
var VV = VV; // version vectorvar IVV = IVV; // interval version vectorvar VVwE = VVwE; // version vector with exceptionsvar PVVwE = PVVwE; // perishing VVwE // #1 Initialize the causality tracking structure with the unique site// identifier 42var vv = 42;var ivv = 42;var vvwe = 42;var pvvwe = 42; // #2 Update the local entry of the local vector. Return a pair// {_e:entry, _c:counter} of the sender which uniquely identifies the operationvar ecVV = vv;var ecIVV = ivv;var ecVVwE = vvwe;var ecPVVwE = pvvwe; // #3 Check if the operation has already been integratedvv;ivv;vvwe;pvvwe; // #4 Check if the operation is ready to be integratedvv; // rvv instance of VVivv; // ecIVV the entry clock specifying a dependency to an ovvwe; // ecVVwE the entry clock specifying a dependency to an oppvvwe; // #5 Increment the local vector with the entry clock of the received// operation supposedly readyvv;ivv;vvwe;pvvwe;