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.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.
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.
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
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.
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
.
Stops a child process on local node by first terminating the process and then deleting it from the supervisor child spec list.