Copyright © 2014, Takeru Ohta <phjgt308@gmail.com>
name() = {name_server_name(), process_name()}
name_server_name() = atom()
otp_name() = {local, Name::atom()} | {global, Name::term()} | {via, module(), Name::term()}
otp_ref() = (Name::atom()) | {Name::atom(), node()} | {global, Name::term()} | {via, module(), Name::term()} | pid()
process_name() = term()
name_server_child_spec/1 | Equivalent to name_server_child_spec(Name, Name, 5000). |
name_server_child_spec/3 | Returns the child spec for a local name server that is used in embedded mode. |
otp_name/1 | Returns OTP compatible name. |
register_name/2 | Locally assocates the name Name with a pid Pid . |
send/2 | Sends the message Msg to the pid locally registered as Name |
start_name_server/1 | Starts a name server process. |
stop_name_server/1 | Stops the name server ServerName |
unregister_name/1 | Removes the locally registered name Name |
whereis_name/1 | Returns the pid with the locally registered name Name |
which_name_servers/0 | Returns a list of running name server. |
which_processes/1 | Returns a list of registered process. |
which_processes/2 | Returns a list of registered process that has a name which matches the pattern Pattern |
name_server_child_spec(Name::name_server_name()) -> supervisor:child_spec()
Equivalent to name_server_child_spec(Name, Name, 5000).
name_server_child_spec(ChildId, ServerName, Shutdown) -> ChildSpec
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 simply addChildSpec
to your supervision tree.
otp_name(Name::name()) -> otp_name()
Returns OTP compatible name
register_name(Name::name(), Pid::pid()) -> yes | no
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 returnsyes
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.
send(Name::name(), Msg::term()) -> pid()
Sends the message Msg
to the pid locally registered as Name
Name
is not a locally registered name, the calling function will exit with reason {badarg, {Name, Msg}}
start_name_server(ServerName::name_server_name()) -> ok | {error, Reason}
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
.
ServerName
the function returnes {error, already_present}
.
stop_name_server(ServerName::name_server_name()) -> ok | {error, Reason}
Stops the name server ServerName
ok
.
If the name server identified by ServerName
does not exist, the function returns {error, not_found}
.
unregister_name(Name::name()) -> ok
Removes the locally registered name Name
whereis_name(Name::name()) -> pid() | undefined
Returns the pid with the locally registered name Name
undefined
if the name is not locally registered.
which_name_servers() -> [name_server_name()]
Returns a list of running name server
which_processes(NameServer::name_server_name()) -> [{process_name(), pid()}]
Returns a list of registered process
which_processes(NameServer::name_server_name(), ProcNamePattern::ets:match_pattern()) -> [{process_name(), pid()}]
Returns a list of registered process that has a name which matches the pattern Pattern
Generated by EDoc, Oct 19 2017, 06:44:03.