[erlang-questions] supervisor creation

Gamoto <>
Wed May 6 14:33:18 CEST 2009


Thank you.
Does it mean that an application can be distributed on several nodes, even if the nodes are on the same machine ?
If yes, what is the benefit ?
># Gamoto 2009-05-06:
>> One of the syntax for the creation of a supervisor process is:
>> 
>> start_link(SupName, Module, Args) ->> Result         with  SupName = {local, Name} | {global, Name}
>> 
>> The manual says:
>> 
>>  If SupName={local, Name} the supervisor is registered locally as  Name using register/2. If SupName={global, Name} the  supervisor
>>  is  registered globally as Name using global:register_name/2. If    no name is provided, the supervisor is not registered.
>> 
>> What does it means ? registered locally ? consequence ? advantages ? registered globally ? etc ...
>
>Registered locally:
>
>  You can use Name::atom() to talk to the supervisor instead of a pid().
>  The alias only works on current node.
>
>Registered globally:
>
>  Like above, but the alias works on every node in your cluster.
>  See also global(3).
>
>> The .app file of an application has already a "registered field" !
>
>From app(3):
>
>  registered:
>    All names of registered processes started  in  this  application.
>    systools  uses this list to detect name clashes between different
>    applications.
>
>IOW this just declares registered names your application is using.
>
>	-- Jachym




More information about the erlang-questions mailing list