Angel J. Alvarez Miguel | 23 Jun 2012 00:33
Picon

simple_one_by_one doesnt join args list properly

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)

Angel J. Alvarez Miguel | 24 Jun 2012 09:07
Picon

Re: simple_one_by_one doesnt join args list properly


Gist for this issue

 git://gist.github.com/2978625.git

/Angel

On Sábado, 23 de Junio de 2012 00:33:18 Angel J. Alvarez Miguel escribió:
> 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"),
(Continue reading)


Gmane