hyparview v0.1.4 Hyparview.Messages.Neighbor View Source

NEIGHBOR request

Link to this section Summary

Functions

If node received a high priority NEIGHBOR request will always accept the request, even if it has to drop a random member from its active view

Send a neighbor message that includes the node name and priority level to a node that chosen from passive_view at random. the priority level may take two values: if it has empty active_view the priority is HIGH, priority is LOW otherwise

Link to this section Types

Link to this type t() View Source
t() :: %Hyparview.Messages.Neighbor{priority: :low | :high, sender: Node.t()}

Link to this section Functions

If node received a high priority NEIGHBOR request will always accept the request, even if it has to drop a random member from its active view.

If received a low priority NEIGHBOR request it will only accept the request if it has a free slot in its active view.

If the NEIGHBOR request rejected, initiator will select another node from its passive view and repeat the whole procedure.

view = Neighbor.handle(neighbor, state.view)
{:noreply, %{state | view: view}}

Send a neighbor message that includes the node name and priority level to a node that chosen from passive_view at random. the priority level may take two values: if it has empty active_view the priority is HIGH, priority is LOW otherwise.

:ok = Neighbor.send!(state.view)
Link to this function send_after(view, base_time) View Source