[erlang-questions 80] Re: [erlang-questions] otp/supervisor immediately goes to "shutdown"

Nick S <>
Mon Mar 28 13:42:38 CEST 2011


Thanks Jesper, this all works now!

Still one question. Is there a way for supervisor to know PIDs of worker
processes, in this case

-----------------------------
module(my_sup).
init() ->
     {ok,{{one_for_one, ......}, [WorkerSpecs]}}.

-----------------------------

One way for supervisor would be to pass self() in argument, and worker
process would send their self() back, but this would be some code in
Supervisor.





On Tue, Mar 8, 2011 at 1:23 PM, Jesper Louis Andersen <
> wrote:

> On Tue, Mar 8, 2011 at 11:50, Nick S <> wrote:
> > Hi,
> >
> > Just hoping to get some help on my query
> >
> > http://forum.trapexit.org/viewtopic.php?t=19641
>
> Your problem is probably that your start_link/1 code in the db module
> is written as:
>
> start_link([S]) ->
>
> where you should have written
>
> start_link(S) ->
>
> as the list is "unpacked" in the supervisor (probably due to an
> apply/3 form). The way you can see this is to up your debugging
> information on the system. Eventually boot with SASL enabled, and also
> look at the spawn options, notably the debug tracing (see gen_server
> and sys module descriptions for enabling this). My guess is though
> that in this case, SASL is enough as you will probably be hitting a
> function_clause error when the supervisor tries to call (the
> equivalent of apply(db, start_link, [S]).
>
>
>
> --
> J.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110328/538f2619/attachment.html>


More information about the erlang-questions mailing list