[erlang-questions] questions about supervisor behavior

Seven Du <>
Mon Dec 27 17:12:07 CET 2010


Thank you all. It works for me. I feel so stupid after I tried all
options but start_link. In my real code the function actually called
start_link but I called gen_server:start() in it.

Thanks again.

On Mon, Dec 27, 2010 at 11:55 PM, Fernando Benavides
<> wrote:
> I think your problem is that you're not linking the workers to the
> supervisor.  Remember the supervisor documentation:
>
> The start function must create and link to the child process, and should
> return {ok,Child} or {ok,Child,Info} where Child is the pid of the child
> process and Info an arbitrary term which is ignored by the supervisor.
>
> You can try using gen_server:start_link/4 (i.e.
> gen_server:start_link({local, Name}, ?MODULE, [], []).) instead of
> gen_server:start/4
>
> Hope this helps :)
>
> On Mon, 2010-12-27 at 23:42 +0800, Seven Du wrote:
>
> Hi all,
>
> I have problems on get the supervisor working.
>
> I want to start a supvisor with 3 children, and then dynamically add
> children. Everything works fine except that when a child crashes, the
> supervisor doesn't know and then cannot restart automatically. What
> I'm doing wrong?
>
> Code in the following link.
>
> https://gist.github.com/756214
>
> Thanks.
> Seven.
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>



-- 
About: http://about.me/dujinfang
Blog: http://www.dujinfang.com
Proj:  http://www.freeswitch.org.cn


More information about the erlang-questions mailing list