23 Jun 2012 00:33
simple_one_by_one doesnt join args list properly
Angel J. Alvarez Miguel <clist <at> uah.es>
2012-06-22 22:33:18 GMT
2012-06-22 22:33:18 GMT
Hi
simple_one_for_one doesnt joint well args from childspec and start_child calls...
group_supervisor:init/1
init(Opts) -> & Opts is a large property list from cmd-line args parsed with getopt
{ok, {
{simple_one_for_one, 1, 60},
[
{mucfsm, {sim_group_fsm, start_link, [Opts]}, transient, 60, worker, [sim_group]}
]
}
}.
test:main/0
main() ->
io:format("Starting simple_one_by_one group supervisor...\n"),
SuppOpts = [{ŕecursive,true},{option1,40}], % This root property list all sup children will inherit it
{ok,Pid} = group_supervisor:start_link(SuppOpts),
wait(5),
io:format("Adding a child dynamically...\n",[]),
FSMOpts = [{fsm2,100}], % This is another property list we want new children to see it also
{ok,_ChildPid} = supervisor:start_child(Pid,[FSMOpts]),
wait(20).
children running sim_group_fsm should be started as :
sim_group_fsm:start_link/1 but sup builds args list the worng way thustrying to call undefined
(Continue reading)
RSS Feed