[erlang-questions] Re: supervisors

Siri Hansen erlangsiri@REDACTED
Thu Mar 31 10:16:43 CEST 2011


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/20110331/454eed71/attachment.htm>


More information about the erlang-questions mailing list