Package vinzclortho :: Module vectorclock
[hide private]
[frames] | no frames]

Module vectorclock

source code

Classes [hide private]
  VectorClock
A vector clock implementation.
  TestVectorClock
Functions [hide private]
 
merge(a, b)
Merges the two vector clocks, using the latest version for each client
source code
 
_joiner(a, b) source code
 
resolve(a, b, joiner=<function _joiner at 0x26be500>)
Resolves the latest value for a and b, which should be a tuple of (VectorClock, value).
source code
 
resolve_list(c, joiner=<function _joiner at 0x26be500>)
Returns the latest/merged value from a list of VectorClock, value tuples
source code
 
resolve_list_extend(list_)
Resolves the list of results to a unified result (which may be a list of concurrent versions)
source code
Variables [hide private]
  __package__ = 'vinzclortho'
Function Details [hide private]

resolve(a, b, joiner=<function _joiner at 0x26be500>)

source code 

Resolves the latest value for a and b, which should be a tuple of (VectorClock, value).

Parameters:
  • a - Tuple of VectorClock, value
  • b - Tuple of VectorClock, value
  • joiner - A function that takes the two values and produces a new value. The default joiner produces a list of the two values
Returns:
A tuple of the merged vector clock and the latest (possibly joined) value.