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() | undefined} | [pid()], id = child_id(), mfargs = mfargs(), restart_type = restart(), shutdown = shutdown(), child_type = worker(), modules = modules()}

child_spec()

child_spec() = #{id := child_id(), start := mfargs(), restart => restart(), shutdown => shutdown(), type => worker(), modules => modules()} | {Id::child_id(), StartFunc::mfargs(), Restart::restart(), Shutdown::shutdown(), Type::worker(), Modules::modules()}

children()

children() = {Ids::[child_id()], Db::#{child_id() => child_rec()}}

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() | undefined, children = children(), dynamics = {maps, #{pid() => list()}} | {sets, sets:set(pid())} | undefined, intensity = non_neg_integer() | undefined, period = pos_integer() | undefined, 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_flags()

sup_flags() = #{strategy => strategy(), intensity => non_neg_integer(), period => pos_integer()} | {RestartStrategy::strategy(), Intensity::non_neg_integer(), Period::pos_integer()}

sup_name()

sup_name() = {local, Name::atom()} | {global, Name::atom()} | {via, Module::module(), Name::any()}

sup_ref()

sup_ref() = (Name::atom()) | {Name::atom(), Node::node()} | {global, Name::atom()} | {via, Module::module(), Name::any()} | pid()

worker()

worker() = worker | supervisor

Function Index

check_childspecs/1
code_change/3
count_children/1
delete_child/2
find_child/2
format_status/2
get_callback_module/1
get_childspec/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
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()]

format_status/2

format_status(X1, X2) -> any()

get_callback_module/1

get_callback_module(Pid) -> Module

get_childspec/2

get_childspec(SupRef, Id) -> Result

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() | {restarting, pid()}}, 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

which_children/1

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


Generated by EDoc