Skip to content

Commit cddb455

Browse files
Qqwyfertapric
authored andcommitted
Improve documentation of GenServer.server() type. (#9082)
1 parent ecda408 commit cddb455

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/elixir/lib/gen_server.ex

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,13 @@ defmodule GenServer do
717717
@typedoc "Debug options supported by the `start*` functions"
718718
@type debug :: [:trace | :log | :statistics | {:log_to_file, Path.t()}]
719719

720-
@typedoc "The server reference"
721-
@type server :: pid | name | {atom, node}
720+
@typedoc """
721+
The server reference.
722+
723+
This is either a plain PID or a value representing a registered name.
724+
See the "Name registration" section of this document for more information.
725+
"""
726+
@type server :: pid | name | {atom, node} | {:via, registry :: module(), key :: term()}
722727

723728
@typedoc """
724729
Tuple describing the client of a call request.
@@ -1022,6 +1027,9 @@ defmodule GenServer do
10221027
not yet connected to the caller one, the semantics differ
10231028
depending on the used Erlang/OTP version.
10241029
1030+
`server` can be any of the values described in the "Name registration"
1031+
section of the documentation for this module.
1032+
10251033
Before Erlang/OTP 21, the call is going to block until a
10261034
connection happens. This was done to guarantee ordering.
10271035
Starting with Erlang/OTP 21, both Erlang and Elixir do

0 commit comments

Comments
 (0)