summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjavimolla <javier.molla.moreno@gmail.com>2015-10-04 11:25:24 +0200
committerjavimolla <javier.molla.moreno@gmail.com>2015-10-04 11:25:24 +0200
commit3eeb9035341731035d4c4fa17ca7f1a4b913112d (patch)
tree0a915f3a983e5f4d02fad9dc67b44858ba733d66
parentfa865ce5c1dc189029207533805da205e39d1bb5 (diff)
downloadelixir-3eeb9035341731035d4c4fa17ca7f1a4b913112d.tar.gz
fix3761: Add more info about :via registry to GenServer
-rw-r--r--lib/elixir/lib/gen_server.ex9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/elixir/lib/gen_server.ex b/lib/elixir/lib/gen_server.ex
index 45b4ad8fe..f99f6ddde 100644
--- a/lib/elixir/lib/gen_server.ex
+++ b/lib/elixir/lib/gen_server.ex
@@ -76,8 +76,13 @@ defmodule GenServer do
term using the functions in the `:global` module.
* `{:via, module, term}` - the GenServer is registered with the given
- mechanism and name. The `:via` option expects a module name to control
- the registration mechanism alongside a name which can be any term.
+ mechanism and name. The `:via` option expects a module that exports
+ `register_name/2`, `unregister_name/1`, `whereis_name/1` and `send/2`
+ functions implemented in `:global` module. These functions are
+ responsible for keeping the list of names of processes and their
+ associated pid's that are available globally for a network of Erlang
+ nodes whereas in the module you could choose to register globally or
+ local with a custom implementation.
For example, we could start and register our Stack server locally as follows: