Module z_supervisor

Supervisor with a one_for_one strategy and disabling of too-often-crashing resources.

Copyright 2010 Marc Worrell

Behaviours: gen_server.

Authors: Marc Worrell (marc@worrell.nl).

Description

Supervisor with a one_for_one strategy and disabling of too-often-crashing resources. All children of this supervisor should be gen_server/supervisor processes.

Function Index

add_child/2Add a child, the child will be added and started.
add_child_async/2
check_children/1Check children, try restarting children when they are in 'error' state.
code_change/3Convert process state when code is changed.
delete_child/2Delete a child, the child will be terminated and removed.
handle_call/3Add a child in the stopped state.
handle_cast/2Async version of the handle_calls({add_child, ...}, ...) above.
handle_info/2Handle the exit of a child.
init/1Initiates the server.
restart_child/2Terminate and restart a child.
running_children/1Return the list of running children.
set_manager_pid/2Set the manager pid for this supervisor.
start_child/2Start a child when it is not running (either failed or stopped).
start_child/3Start a child when it is not running (either failed or stopped).
start_link/1
start_link/2
stop_child/2Stop a child, the child will be terminated and put in "stopped" state.
terminate/2This function is called by a gen_server when it is about to terminate.
which_children/1Return the list of all children and their run state.

Function Details

add_child/2

add_child(Pid, ChildSpec) -> any()

Add a child, the child will be added and started.

add_child_async/2

add_child_async(Pid, ChildSpec) -> any()

check_children/1

check_children(Pid) -> any()

Check children, try restarting children when they are in 'error' state.

code_change/3

code_change(OldVsn, State, Extra) -> {ok, NewState}

Convert process state when code is changed

delete_child/2

delete_child(Pid, Name) -> any()

Delete a child, the child will be terminated and removed.

handle_call/3

handle_call(Message::Request, From, State) -> {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}

Add a child in the stopped state.

handle_cast/2

handle_cast(Message, State) -> any()

Async version of the handle_calls({add_child, ...}, ...) above

handle_info/2

handle_info(Info, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

Handle the exit of a child

init/1

init(InitialChildren::Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}

Initiates the server.

restart_child/2

restart_child(Pid, Name) -> any()

Terminate and restart a child.

running_children/1

running_children(Pid) -> any()

Return the list of running children

set_manager_pid/2

set_manager_pid(Pid, ManagerPid) -> any()

Set the manager pid for this supervisor

start_child/2

start_child(Pid, Name) -> any()

Start a child when it is not running (either failed or stopped)

start_child/3

start_child(Pid, Name, Timeout) -> any()

Start a child when it is not running (either failed or stopped)

start_link/1

start_link(Args) -> any()

start_link/2

start_link(SupName, Args) -> any()

stop_child/2

stop_child(Pid, Name) -> any()

Stop a child, the child will be terminated and put in "stopped" state

terminate/2

terminate(Reason, State) -> void()

This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.

which_children/1

which_children(Pid) -> any()

Return the list of all children and their run state.


Generated by EDoc, Sep 2 2014, 15:01:16.