hyparview v0.1.4 Hyparview.Messages.ForwardJoin View Source

FORWARDJOIN request abstraction module

Link to this section Summary

Functions

Send to all other nodes in the active view a ForwardJoin request containing the new node

  1. If the time to live is equal to zero or if the number of nodes in p’s active view is equal to one, it will add the new node to its active view. This step is performed even if a random node must be dropped from the active view. In the later case, the node being ejected from the active view receives a DISCONNECT notification

Link to this section Types

Link to this type t() View Source
t() :: %Hyparview.Messages.ForwardJoin{
  joined_node: Node.t(),
  sender: Node.t(),
  ttl: non_neg_integer()
}

Link to this section Functions

Send to all other nodes in the active view a ForwardJoin request containing the new node.

Link to this function handle(forward_join, view) View Source
handle(t(), Hyparview.View.t()) ::
  {:ok, Hyparview.View.t()} | {{:error, reason :: term()}, Hyparview.View.t()}
  1. If the time to live is equal to zero or if the number of nodes in p’s active view is equal to one, it will add the new node to its active view. This step is performed even if a random node must be dropped from the active view. In the later case, the node being ejected from the active view receives a DISCONNECT notification.

  2. If the time to live is equal to PRWL, p will insert the new node into its passive view.

  3. The time to live field is decremented.

  4. If, at this point, n has not been inserted in p’s active view, p will forward the request to a random node in its active view (different from the one from which the request was received).

Link to this function new(options) View Source
new(join: struct(), ttl: non_neg_integer()) :: t()