adizere
adizere

Reputation: 222

Confusion regarding abcast function and uniqueness of gen_server names

From erlang.org/doc, the gen_server section:

start_link(ServerName, Module, Args, Options) -> Result

If there already exists a process with the specified ServerName the function returns {error,{already_started,Pid}}

Apparently, Erlang does not allow multiple processes to have the same name.

Good, now let's look at another function:

abcast(Name, Request) -> abcast

Sends an asynchronous request to the gen_servers locally registered as Name at the specified nodes.

Notice the use of plural form.

Since Erlang requires unique name for gen_server processes, why would the abcast function implement async message sending to multiple processes that have the same name?

What am I missing?

Upvotes: 0

Views: 174

Answers (1)

P_A
P_A

Reputation: 1818

Sends an asynchronous request to the gen_servers locally registered as Name at the specified nodes.

You can have several nodes with process registred as Name.

Upvotes: 2

Related Questions