Module supervisor2

Behaviours: gen_server.

This module defines the supervisor2 behaviour.
Required callback functions: init/1.

Data Types

call()

call() = which_children | count_children | {term(), term()}

XXX: refine

child()

child() = undefined | pid()

child_id()

child_id() = term()

child_rec()

child_rec() = #child{pid = child() | {restarting, pid()} | [pid()], name = child_id(), mfargs = mfargs(), restart_type = restart(), shutdown = shutdown(), child_type = worker(), modules = modules()}

child_spec()

child_spec() = {Id::child_id(), StartFunc::mfargs(), Restart::restart(), Shutdown::shutdown(), Type::worker(), Modules::modules()}

delay()

delay() = non_neg_integer()

init_sup_name()

init_sup_name() = sup_name() | self

mfargs()

mfargs() = {M::module(), F::atom(), A::[term()] | undefined}

modules()

modules() = [module()] | dynamic

restart()

restart() = permanent | transient | temporary | intrinsic | {permanent, delay()} | {transient, delay()} | {intrinsic, delay()}

shutdown()

shutdown() = brutal_kill | timeout()

startchild_err()

startchild_err() = already_present | {already_started, Child::child()} | term()

startchild_ret()

startchild_ret() = {ok, Child::child()} | {ok, Child::child(), Info::term()} | {error, startchild_err()}

startlink_err()

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

startlink_ret()

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

state()

state() = #state{name = any(), strategy = strategy(), children = [child_rec()], dynamics = dict:dict() | set:set() | undefined, intensity = non_neg_integer(), period = pos_integer(), restarts = any(), dynamic_restarts = non_neg_integer(), module = any(), args = any()}

stop_rsn()

stop_rsn() = {shutdown, term()} | {bad_return, {module(), init, term()}} | {bad_start_spec, term()} | {start_spec, term()} | {supervisor_data, term()}

strategy()

strategy() = one_for_all | one_for_one | rest_for_one | simple_one_for_one

sup_name()

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

sup_ref()

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

worker()

worker() = worker | supervisor

Function Index

check_childspecs/1
code_change/3
count_children/1
delete_child/2
find_child/2
handle_call/3
handle_cast/2
handle_info/2
init/1
restart_child/2
start_child/2
start_link/2
start_link/3
terminate/2
terminate_child/2
try_again_restart/3
which_children/1

Function Details

check_childspecs/1

check_childspecs(ChildSpecs) -> Result

code_change/3

code_change(X1::term(), State::state(), X3::term()) -> {ok, state()} | {error, term()}

count_children/1

count_children(SupRef) -> PropListOfCounts

delete_child/2

delete_child(SupRef, Id) -> Result

find_child/2

find_child(Supervisor, Name) -> [pid()]

handle_call/3

handle_call(X1::call(), From::term(), State::state()) -> {reply, term(), state()}

handle_cast/2

handle_cast(X1::{try_again_restart, child_id() | pid(), term()}, State::state()) -> {noreply, state()} | {stop, shutdown, state()}

handle_info/2

handle_info(Msg::term(), State::state()) -> {noreply, state()} | {stop, shutdown, state()}

init/1

init(X1::{init_sup_name(), module(), [term()]}) -> {ok, state()} | ignore | {stop, stop_rsn()}

restart_child/2

restart_child(SupRef, Id) -> Result

start_child/2

start_child(SupRef, ChildSpec) -> startchild_ret()

start_link/2

start_link(Module, Args) -> startlink_ret()

start_link/3

start_link(SupName, Module, Args) -> startlink_ret()

terminate/2

terminate(Reason::term(), State::state()) -> ok

terminate_child/2

terminate_child(SupRef, Id) -> Result

try_again_restart/3

try_again_restart(SupRef, Child, Reason) -> ok

which_children/1

which_children(SupRef) -> [{Id, Child, Type, Modules}]


Generated by EDoc