[erlang-questions] Re: supervisors

Siri Hansen erlangsiri@REDACTED
Fri Apr 1 11:48:59 CEST 2011


Attached you can find my small sample.  Please have a look and let me know
what differs.
Just to add some confusion, my a_sup corresponds to your eapp_sup and my
a_sup_2 corresponds to your a_sup.... ;)
/siri

2011/3/31 Wes James <comptekki@REDACTED>

> Siri,
>
> The code is from last weeks training part of the Erlang Factory in San
> Francisco.  I don't know if Erlang Solutions would like me sending all
> the code to people or not.  I'd send it to you off-list if it was ok
> with them.
>
> Or maybe you could send me a sample of your code to compare with what I
> have.
>
> thx,
>
> -wes
>
> On Thu, Mar 31, 2011 at 2:16 AM, Siri Hansen <erlangsiri@REDACTED> wrote:
> > Hi Wes,
> > It should be possible to do exactly what you want. I have tried to
> recreate
> > your problem, but I did not succeed. If you want to you may post the code
> > for the two supervisors and I will have a look at it to see what I'm
> doing
> > different.
> > Regards
> > /siri
> >
> >
> > 2011/3/30 Wes James <comptekki@REDACTED>
> >>
> >> when I start and app that works fine:
> >>
> >> =PROGRESS REPORT==== 30-Mar-2011::11:28:05 ===
> >>          supervisor: {local,eapp_sup}
> >>             started: [{pid,<0.70.0>},
> >>                       {name,{a_sup,a1}},
> >>                       {mfargs,{a_sup,start_link,[a1]}},
> >>                       {restart_type,permanent},
> >>                       {shutdown,brutal_kill},
> >>                       {child_type,supervisor}]
> >>
> >> In eapp_sup I have:
> >>
> >> start_a(Module, Name) ->
> >>        supervisor:start_child(?MODULE, child(Module, Name)).
> >>
> >>
> >> child(Module, Name) ->
> >>  {{Module, Name}, {Module, start_link, [Name]}, permanent,
> >> brutal_kill, supervisor, [Name]}.
> >>
> >>
> >> from starting above it would seem that a_sup has the name a1, but if
> >> you run appmon it shows just as a_sup.
> >>
> >> When I then run
> >>
> >> eapp:start_a(a_sup,a2).  I would assume that a_sup could load as a
> >> second supervisor process with name a2, but this is what I get:
> >>
> >> eapp_sup:start_a(a_sup,a2).
> >> {error,{already_started,<0.70.0>}}
> >>
> >> I then create a_sup2  and eapp_sup:start_a(a_sup2, a1) and that loads
> >> fine, since the module "name" is not the same in the system as a_sup.
> >> But it seems like a name should be assigned to these to make them
> >> unique by name and be able to use the same supervisor code to
> >> supervise some more children.
> >>
> >> Is that possible?
> >>
> >> thx,
> >>
> >> -wes
> >> _______________________________________________
> >> erlang-questions mailing list
> >> 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/20110401/8bed47a2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: siris_a.tgz
Type: application/x-gzip
Size: 1126 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110401/8bed47a2/attachment.bin>


More information about the erlang-questions mailing list