View Source ProcessHub.DistributedSupervisor behaviour (ProcessHub v0.3.2-alpha)

The ProcessHub distributed supervisor module is responsible for starting and stopping the child processes distributed across the cluster.

Each ProcessHub instance has its own distributed supervisor that manages local child processes.

Summary

Functions

See :supervisor.behaviour_info/1.

See :supervisor.code_change/3.

See :supervisor.format_log/1.

See :supervisor.format_log/2.

See :supervisor.get_callback_module/1.

See :supervisor.handle_call/3.

See :supervisor.handle_cast/2.

Handles the process exit messages for the child processes.

Returns true if the child process is running on local node.

Initializes the distributed supervisor with the given arguments.

Returns the child process ids that are running on local node.

Returns a list of processe pairs in the form of {child_id, pid} that are running on local node.

Returns the child process pid if it is running on local node.

Starts a child process on local node.

Starts the distributed supervisor with the given arguments.

See :supervisor.terminate/2.

Stops a child process on local node by first terminating the process and then deleting it from the supervisor child spec list.

Functions

See :supervisor.behaviour_info/1.

See :supervisor.check_childspecs/1.

Link to this function

check_childspecs(arg1, arg2)

View Source

See :supervisor.check_childspecs/2.

Link to this function

code_change(arg1, arg2, arg3)

View Source

See :supervisor.code_change/3.

See :supervisor.count_children/1.

Link to this function

delete_child(arg1, arg2)

View Source

See :supervisor.delete_child/2.

See :supervisor.format_log/1.

See :supervisor.format_log/2.

Link to this function

get_callback_module(arg1)

View Source

See :supervisor.get_callback_module/1.

Link to this function

get_childspec(arg1, arg2)

View Source

See :supervisor.get_childspec/2.

Link to this function

handle_call(arg1, arg2, arg3)

View Source

See :supervisor.handle_call/3.

See :supervisor.handle_cast/2.

Link to this function

handle_info(request, state)

View Source

Handles the process exit messages for the child processes.

We delegate the work the the :supervisor.handle_info/2 function and then propagate the event to the Dispatcher module to notify the other nodes about the child process failure.

Link to this function

has_child?(distributed_sup, child_id)

View Source

Returns true if the child process is running on local node.

Initializes the distributed supervisor with the given arguments.

We will call the Erlang :supervisor.init/1 function with the given arguments. this in turn will call the init/1

Link to this function

local_child_ids(distributed_sup)

View Source
@spec local_child_ids(atom() | pid() | {atom(), any()} | {:via, atom(), any()}) ::
  list()

Returns the child process ids that are running on local node.

Link to this function

local_children(distributed_sup)

View Source

Returns a list of processe pairs in the form of {child_id, pid} that are running on local node.

Link to this function

local_pid(distributed_sup, child_id)

View Source

Returns the child process pid if it is running on local node.

Link to this function

restart_child(arg1, arg2)

View Source

See :supervisor.restart_child/2.

Link to this function

start_child(distributed_sup, child_spec)

View Source

Starts a child process on local node.

Starts the distributed supervisor with the given arguments.

We will call the GenServer.start_link/3 and register our current module as the base module, this way we can overwrite the handle_info/2 function on the :supervisor module to handle the :EXIT messages our selves.

See :supervisor.terminate/2.

Link to this function

terminate_child(distributed_sup, child_id)

View Source

Stops a child process on local node by first terminating the process and then deleting it from the supervisor child spec list.

See :supervisor.which_children/1.