[erlang-questions] starting of two instances of server

info info@REDACTED
Fri May 22 19:32:04 CEST 2009


Hi all,

I want, from a supervisor, to start two childs having the same code (the same gen_server, called here generic), with two parameters.
Does this syntax correct ?
- the first parameter is one number
- the second parameter is one function.

init()->
Spec1= {id1, generic, start_link, [par1_1,par2_1],permanent, brutal_kill,worker, [generic]},
Spec2= {id2, generic, start_link, [par1_2,par2_2],permanent, brutal_kill,worker, [generic]},
Childs= [Spec1,Spec2],
case supervisor:check_childspecs(Childs) of
{ok} ->
    SChilds={{one_for_one,2,10},Childs),
    {ok,SChilds};
{error,Reason} ->
    io:format("Error: ~s~n", [Reason]),
   {error,Reason}
end.

If yes, as I have the following error, I suppose the error is deep.
If no, could you tell me the correct syntax or document to be read ?

application: toto
exited: {bad_return, {{toto,start,[normal,[]]},
{'EXIT', {badarg, [{io,format, [<0.86.0>, "--> Error : ~s~n",
[{{case_clause,ok}, [{toto_supervisor,init,1}, {supervisor,init,1}, {gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}]}]]}, {application_master,start_it_old,4}]}}}}
type: temporary 
J-Ph. Constantin
info@REDACTED
meyrin/geneva
switzerland
+41793265281
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090522/5f4b886d/attachment.htm>


More information about the erlang-questions mailing list