Copyright © 2016 Takeru Ohta <phjgt308@gmail.com> This software is released under the MIT License. See the LICENSE file in the project root for full license information.
An evel based global name registration facility
This module is available as a via
callback module for OTP behaviours (e.g., supervisor, gen_server, etc).
%% %% Example %% gen_server:start_link({via, evel_name, SomeName}, ?MODULE, [], []).
name() = term()
A name of the process
register_name/2 | Globally associates the name Name with a pid Pid |
send/2 | Sends the message Message to the pid globally registered as Name |
unregister_name/1 | Removes the globally registered name Name |
whereis_name/1 | Returns the pid with the globally registered name Name |
register_name(Name::name(), Pid::pid()) -> yes | no
Globally associates the name Name
with a pid Pid
The function returns yes
if successful, no
if it fails.
For example, no
is returned if an attempt is made to register a process with a name that is already in use.
Unlike global:register_name/1
, this function allows a process to have multiple names.
send(Name::name(), Message::term()) -> pid()
Sends the message Message
to the pid globally registered as Name
Name
is not a registered name, the calling function will exit with reason {badarg, {Name, Message}}
unregister_name(Name::name()) -> ok
Removes the globally registered name Name
whereis_name(Name::name()) -> pid() | undefined
Returns the pid with the globally registered name Name
undefined
if the name is not registered.
Generated by EDoc, Oct 29 2017, 01:52:16.