Helios v0.1.0 Helios.Registry.Tracker.IntervalTreeClock View Source

This is an implementation of an Interval Clock Tree, ported from the implementation in Erlang written by Paulo Sergio Almeida psa@di.uminho.pt found here.

Link to this section Summary

Functions

Compares two clocks. If :eq is returned, the two clocks are causally equivalent If :lt is returned, the first clock is causally dominated by the second If :gt is returned, the second clock is causally dominated by the first If :concurrent is returned, the two clocks are concurrent (conflicting)

Decodes the clock from a binary

Encodes the clock as a binary

Records an event on the given clock

Forks a clock containing a shared causal history, used for creating new replicas

Joins two forked clocks into a single clock with both causal histories, used for retiring a replica

Returns the length of the encoded binary representation of the clock

Determines if the left-hand clock is causally dominated by the right-hand clock. If the left-hand clock is LEQ than the right-hand clock, and vice-versa, then they are causally equivalent

Gets a snapshot of a clock without its identity. Useful for sending the clock with messages, but cannot be used to track events

Creates a new interval tree clock

Link to this section Types

Link to this section Functions

Compares two clocks. If :eq is returned, the two clocks are causally equivalent If :lt is returned, the first clock is causally dominated by the second If :gt is returned, the second clock is causally dominated by the first If :concurrent is returned, the two clocks are concurrent (conflicting)

Link to this function decode(b) View Source
decode(binary()) ::
  {:ok, Helios.Registry.Tracker.IntervalTreeClock.t()}
  | {:error, {:invalid_clock, term()}}

Decodes the clock from a binary

Encodes the clock as a binary

Forks a clock containing a shared causal history, used for creating new replicas.

Joins two forked clocks into a single clock with both causal histories, used for retiring a replica.

Returns the length of the encoded binary representation of the clock

Determines if the left-hand clock is causally dominated by the right-hand clock. If the left-hand clock is LEQ than the right-hand clock, and vice-versa, then they are causally equivalent.

Gets a snapshot of a clock without its identity. Useful for sending the clock with messages, but cannot be used to track events.

Creates a new interval tree clock