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
- 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
t() :: %Hyparview.Messages.ForwardJoin{ joined_node: Node.t(), sender: Node.t(), ttl: non_neg_integer() }
Link to this section Functions
broadcast!(Hyparview.Messages.Join.t(), Hyparview.View.t()) :: :ok
Send to all other nodes in the active view a ForwardJoin request containing the new node.
handle(t(), Hyparview.View.t()) :: {:ok, Hyparview.View.t()} | {{:error, reason :: term()}, Hyparview.View.t()}
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.
If the time to live is equal to PRWL, p will insert the new node into its passive view.
The time to live field is decremented.
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).