BPXE.Token (bpxe v0.4.0)
Link to this section Summary
Functions
Distance between generations of two tokens. Returns nil
if they are not
in the same activation (comparing them is useless), otherwise it's a number
of single incremenets from the first token to the second one (positive means
the second message is younger, negative is older, zero is it's the same generation)
Merges two tokens
Link to this section Functions
activation(token)
distance(first, second)
Distance between generations of two tokens. Returns nil
if they are not
in the same activation (comparing them is useless), otherwise it's a number
of single incremenets from the first token to the second one (positive means
the second message is younger, negative is older, zero is it's the same generation)
generation(token)
later_than(_, _)
merge(t1, token)
Merges two tokens
Examples
iex> BPXE.Token.merge(BPXE.Token.new(token_id: 1, payload: %{"a" => 1, "b" => %{"c" => 2}}), iex> BPXE.Token.new(token_id: 1, payload: %{"a" => 2, "b" => %{"d" => 4}})).payload %{"a" => 2, "b" => %{"c" => 2, "d" => 4}}
new(options \\ [])
new(map_or_kwlist, opts \\ [])
Specs
new(ExConstructor.map_or_kwlist(), Keyword.t()) :: %BPXE.Token{ __generation__: term(), payload: term(), token_id: term() }