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

Rad Gruchalski radek@REDACTED
Thu Mar 26 17:11:40 CET 2015


Can you show start_link of the uclient_worker?










Kind regards,

Radek Gruchalski

radek@REDACTED (mailto:radek@REDACTED)
 (mailto:radek@REDACTED)
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
> erlang-questions@REDACTED (mailto:erlang-questions@REDACTED)
> http://erlang.org/mailman/listinfo/erlang-questions
>  
>  


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


More information about the erlang-questions mailing list