View Source ProcessHub.DistributedSupervisor behaviour (ProcessHub v0.8.0)
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
Initializes the distributed supervisor with the given arguments.
Returns the pid of child_id when it runs under this node's supervisor,
else nil. Read from the supervisor's table, so it never waits on the
supervisor, which may be busy starting a child whose init calls the hub.
Starts a child process on local node.
Starts the distributed supervisor with the given arguments.
Stops a child process on local node by first terminating the process and then deleting it from the supervisor child spec list.
Functions
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
@spec running_pid(ProcessHub.Hub.t(), ProcessHub.child_id()) :: pid() | nil
Returns the pid of child_id when it runs under this node's supervisor,
else nil. Read from the supervisor's table, so it never waits on the
supervisor, which may be busy starting a child whose init calls the hub.
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.
Stops a child process on local node by first terminating the process and then deleting it from the supervisor child spec list.