Module sup

Supervisor helper functions for better control of startup phase.

Copyright © 2007-2015 Zuse Institute Berlin

Version: $Id$

Authors: Florian Schintke (schintke@zib.de).

Description

Supervisor helper functions for better control of startup phase.

Start the supervisor separately and then add its childs one after the other.

Data Types

prefix()

prefix() = nonempty_maybe_improper_list(string(), string())

startlink_err()

startlink_err() = {already_started, pid()} | shutdown | term()

startlink_ret()

startlink_ret() = {ok, pid()} | {error, startlink_err()}

sup_name()

sup_name() = {local, Name :: atom()} | {global, Name :: atom()}

sup_ref()

sup_ref() = (Name :: atom())
          | {Name :: atom(), Node :: node()}
          | {global, Name :: atom()}
          | pid()

Function Index

start_sup_as_child/3
sup_get_all_children/1
sup_start/3
sup_terminate/1
sup_terminate_childs/1Terminates all children of the given supervisor(s) gracefully, i.e.
supervisor_desc/3Creates a supervisor description for a supervisor.
supervisor_desc/4Creates a supervisor description for a supervisor.
worker_desc/3Creates a worker description for a supervisor.
worker_desc/4Creates a worker description for a supervisor.

Function Details

sup_start/3

sup_start(Supervisor :: sup_name(),
          Module :: module(),
          Options :: term()) ->
             startlink_ret()

start_sup_as_child/3

start_sup_as_child(Prefix :: prefix(),
                   AtSup :: sup_ref() | no_name,
                   SupAsChild :: supervisor:child_spec()) ->
                      supervisor:startchild_ret()

worker_desc/3

worker_desc(Name :: atom() | string() | {atom(), pos_integer()},
            Module :: module(),
            Function :: atom()) ->
               {Name :: atom()
                      | string()
                      | {atom(), pos_integer()},
                {Module :: module(),
                 Function :: atom(),
                 Options :: []},
                permanent,
                brutal_kill,
                worker,
                []}

Creates a worker description for a supervisor.

worker_desc/4

worker_desc(Name :: atom() | string() | {atom(), pos_integer()},
            Module :: module(),
            Function :: atom(),
            Options :: list()) ->
               {Name :: atom()
                      | string()
                      | {atom(), pos_integer()},
                {Module :: module(),
                 Function :: atom(),
                 Options :: list()},
                permanent,
                brutal_kill,
                worker,
                []}

Creates a worker description for a supervisor.

supervisor_desc/3

supervisor_desc(Name :: atom()
                      | string()
                      | {atom(), pos_integer()},
                Module :: module(),
                Function :: atom()) ->
                   {Name :: atom()
                          | string()
                          | {atom(), pos_integer()},
                    {Module :: module(),
                     Function :: atom(),
                     Options :: []},
                    permanent,
                    brutal_kill,
                    supervisor,
                    []}

Creates a supervisor description for a supervisor.

supervisor_desc/4

supervisor_desc(Name :: atom()
                      | string()
                      | {atom(), pos_integer()},
                Module :: module(),
                Function :: atom(),
                Options :: list()) ->
                   {Name :: atom()
                          | string()
                          | {atom(), pos_integer()},
                    {Module :: module(),
                     Function :: atom(),
                     Options :: list()},
                    permanent,
                    brutal_kill,
                    supervisor,
                    []}

Creates a supervisor description for a supervisor.

sup_terminate/1

sup_terminate(Supervisor :: pid() | atom()) -> ok

sup_terminate_childs/1

sup_terminate_childs(Supervisor :: Proc | [Proc]) -> ok

Terminates all children of the given supervisor(s) gracefully, i.e. first stops all gen_component processes and then terminates all children recursively. Note: the children beneath the given supervisor pids MUST NOT overlap!

sup_get_all_children/1

sup_get_all_children(Supervisor :: pid() | atom()) -> [pid()]


Generated by EDoc, Aug 2 2016, 13:42:59.