Mon May 2 20:25:57 CEST 2011
You can also "not register" them, either locally or globally. In your
child's start_link, use the gen_server/3 instead of gen_server/4.
You cannot do a "whereis(service)" type call, but your children will run and
you won't get the conflicting IDs.
On Mon, May 2, 2011 at 10:17 AM, Gregory Haskins
> On 5/2/11 12:38 PM, Martin Dimitrov wrote:
> > Thanks for the advise about the interface.
> >> A normal (i.e. not simple_on_for_one) supervisor allows you to stop,
> > restart and delete children processes, so it needs a way to identify
> > them. Hence the id.
> > Isn't the process id the natural choice for these purposes?
> Its chicken and egg, though. The supervisor spawns the process and you
> have to give it an ID to instruct it to start_child() in the first place.
> > So there is no way to avoid the need of unique ids if using anything
> > other than simple_one_for_one?
> When I don't care, I just use erlang:now() for the ID. Sloppy, perhaps,
> but it gets the job done.
> Kind Regards,
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions