[erlang-questions] Issue while starting same worker(gen_server) multiple times in Supervisor

Rad Gruchalski <>
Thu Mar 26 17:15:55 CET 2015


By the way, you want to use atoms for names:  

Children = [?CHILD(uc1, Address), ?CHILD(uc2, Address)],  

Give it a shot.  










Kind regards,

Radek Gruchalski

 (mailto:)
 (mailto:)
de.linkedin.com/in/radgruchalski/ (http://de.linkedin.com/in/radgruchalski/)

Confidentiality:
This communication is intended for the above-named person and may be confidential and/or legally privileged.
If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately.



On Thursday, 26 March 2015 at 17:11, Rad Gruchalski wrote:

> Can you show start_link of the uclient_worker?
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> Kind regards,

> Radek Gruchalski
> 
 (mailto:)
 (mailto:)
> de.linkedin.com/in/radgruchalski/ (http://de.linkedin.com/in/radgruchalski/)
>  
> Confidentiality:
> This communication is intended for the above-named person and may be confidential and/or legally privileged.
> If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately.
>  
>  
>  
> On Thursday, 26 March 2015 at 15:49, harsha sri wrote:
>  
> > Hi,
> >  
> > I am trying to start same worker multiple times in Supervisor but its giving me error.
> > Here is my Supervisor:
> >  
> >  
> > -module(uclient_sup).
> >  
> > -behaviour(supervisor).
> >  
> > -export([start_link/0, init/1]).
> >  
> > -define(
> >    CHILD(Name, Args),
> >    {Name, {
> >        uclient_worker, start_link, [{<<"callmgr">> , 3}]
> >        }, permanent, 5000, worker, []
> >    }
> > ).
> >  
> > start_link() ->
> >     supervisor:start_link({global, ?MODULE}, ?MODULE, _Arg = []).
> >  
> > init([]) ->
> >    Children = [?CHILD("uc1", Address), ?CHILD("uc2", Address)],
> >    {ok, { {one_for_one, 6, 10}, Children }}.
> >  
> > I am getting below error:
> >  
> > Error: {could_not_start,uclient,
> >            {{shutdown,
> >                 {failed_to_start_child,"uc2",{already_started,<5169.429.0>}}},
> >             {uclient,start,[normal,[]]}}}
> >  
> >  
> > Please help me in solving this issue. I am new to erlang.
> >  
> > Thanks & Regards,
> > SriHarsha.
> > _______________________________________________
> > erlang-questions mailing list
> >  (mailto:)
> > http://erlang.org/mailman/listinfo/erlang-questions
> >  
> >  
> >  
>  
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150326/37e88145/attachment.html>


More information about the erlang-questions mailing list