Algorithm-VectorClocks
view release on metacpan or search on metacpan
lib/Algorithm/VectorClocks.pm view on Meta::CPAN
=head2 $vc->clocks
Returns the vector of clocks.
=head2 order_vector_clocks({ $id => $vc, ... })
Returns the list of server IDs in order (the latest comes first).
The arguments can be a HASH reference of server IDs and their vector clocks.
If some vector clocks are same or independently updated (cannot be ordered),
they are packed into single element as an array reference.
In the following example, vector clocks of A and C are independent with each other,
and B is older than them:
@res = order_vector_clocks({ A => $vc_a, B => $vc_b, C => $vc_c });
$res[0][0]; # is 'A' or 'C'
$res[0][1]; # is 'A' or 'C'
$res[1]; # is 'B'
( run in 0.242 second using v1.01-cache-2.11-cpan-05444aca049 )