A Local Name Registration Facility. Copyright (c) 2014, Takeru Ohta phjgt308@gmail.com
Equivalent to name_server_child_spec(Name, Name, 5000)
.
Returns the child spec for a local name server that is used in embedded mode.
To embed a local name server in your application, you can add the child spec ChildSpec
to your supervision tree.
Locally assocates the name Name
with a pid Pid
.
Let NameServer
is element(1, Name)
, the registered name is limited to the name server NameServer
scope.
Assumes that the name server is already started, crashes otherwise.
The function returns yes
if successful, no
if it failes. For example, no
is returned if an attempt is made to register an already registered process or to register a process with a name that is already in use.
Sends the message Msg
to the pid locally registered as Name
Failure: If Name
is not a locally registered name, the calling function will exit with reason {badarg, {Name, Msg}}
Starts a name server process
The process is registered locally as ServerName
using register/2
.
If the process is successfully started the function returns ok
.
If there already exists a process with the specified ServerName
the function returnes {error, already_present}
.
Stops the name server ServerName
If successful, the function returns ok
. If the name server identified by ServerName
does not exist, the function returns {error, not_found}
.
Removes the locally registered name Name
Returns the pid with the locally registered name Name
Returns undefined
if the name is not locally registered.
Returns a list of running name server