phoenix_pubsub v2.0.0 Phoenix.Tracker.State View Source
Provides an ORSWOT CRDT.
Link to this section Summary
Functions
Returns the causal context for the set.
Compacts a sets causal history.
Returns the dize of the delta.
Extracts the set's elements from ets into a mergeable list.
Returns a list of elements for the topic who belong to an online replica.
Returns all elements for the pid.
Returns the element matching the pid, topic, and key.
Returns a list of elements for the topic who belong to an online replica.
Checks if set has a non-empty delta.
Adds a new element to the set.
Removes all elements from the set for the given pid.
Removes an element from the set.
Merges two sets, or a delta into a set.
Creates a new set for the replica.
Returns a list of elements in the set belonging to an online replica.
Removes all elements for replicas that are permanently gone.
Marks a replica as down in the set and returns left users.
Marks a replica as up in the set and returns rejoined users.
Resets the set's delta.
Performs table lookup for tracked key in the topic.
Performs table lookup for tracked elements in the topic.
Link to this section Types
Link to this section Functions
Returns the causal context for the set.
Compacts a sets causal history.
Called as needed and after merges.
Returns the dize of the delta.
Extracts the set's elements from ets into a mergeable list.
Used when merging two sets.
Returns a list of elements for the topic who belong to an online replica.
Returns all elements for the pid.
Returns the element matching the pid, topic, and key.
Returns a list of elements for the topic who belong to an online replica.
Checks if set has a non-empty delta.
Adds a new element to the set.
Removes all elements from the set for the given pid.
Removes an element from the set.
Merges two sets, or a delta into a set.
Returns a 3-tuple of the updated set, and the joined and left elements.
Examples
iex> {s1, joined, left} =
Phoenix.Tracker.State.merge(s1, Phoenix.Tracker.State.extract(s2))
{%Phoenix.Tracker.State{}, [...], [...]}
Creates a new set for the replica.
Examples
iex> Phoenix.Tracker.State.new(:replica1)
%Phoenix.Tracker.State{...}
Returns a list of elements in the set belonging to an online replica.
Removes all elements for replicas that are permanently gone.
Marks a replica as down in the set and returns left users.
Marks a replica as up in the set and returns rejoined users.
Resets the set's delta.
Performs table lookup for tracked key in the topic.
Filters out those present on downed replicas.
Performs table lookup for tracked elements in the topic.
Filters out those present on downed replicas.