Network.ConnectionCheck (ElevatorProject v0.1.0)

Evaluates if the elevator must request a backup, by checking if the node newly connected to the cluster.

Uses the modules:

  • OrderDistributor

Link to this section Summary

Functions

Checks the current list of connected nodes and compares it to the previous list of nodes. If the list goes from empty to not empty, the node requests a backup by calling ´OrderDistributor.request_backup/0´.

Returns a specification to start this module under a supervisor.

Link to this section Functions

Link to this function

check_connection(prev_connected_nodes)

Checks the current list of connected nodes and compares it to the previous list of nodes. If the list goes from empty to not empty, the node requests a backup by calling ´OrderDistributor.request_backup/0´.

Parameters

  • prev_connected_nodes: list of the previously connected nodes :: list()

Return

  • no_return
Link to this function

child_spec(arg)

Returns a specification to start this module under a supervisor.

arg is passed as the argument to Task.start_link/1 in the :start field of the spec.

For more information, see the Supervisor module, the Supervisor.child_spec/2 function and the Supervisor.child_spec/0 type.