DistributedSupervisor.Listener behaviour (distributed_supervisor v0.5.3)

View Source

The implementation of this behaviour might be passed to DistributedSupervisor.start_link/1 to receive notifications about processes state.

Summary

Callbacks

on_node_down(name, node, info)

(optional)
@callback on_node_down(
  name :: DistributedSupervisor.name(),
  node :: node(),
  info :: map() | keyword()
) :: :ok

on_node_terminate(name, node, reason, statuses)

(optional)
@callback on_node_terminate(
  name :: DistributedSupervisor.name(),
  node :: node(),
  reason :: :normal | :shutdown | {:shutdown, term()} | term(),
  statuses :: [{:status, pid(), {:module, module()}, [term()]}]
) :: :ok

on_node_up(name, node, info)

(optional)
@callback on_node_up(
  name :: DistributedSupervisor.name(),
  node :: node(),
  info :: map() | keyword()
) :: :ok

on_process_start(name, id, pid)

(optional)
@callback on_process_start(
  name :: DistributedSupervisor.name(),
  id :: DistributedSupervisor.id(),
  pid :: pid()
) :: :ok

on_process_stop(name, id, pids)

(optional)
@callback on_process_stop(
  name :: DistributedSupervisor.name(),
  id :: DistributedSupervisor.id(),
  pids :: [pid()]
) :: :ok