diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml index ad1deed96507..8ca39288f390 100644 --- a/lib/stdlib/doc/src/gen_server.xml +++ b/lib/stdlib/doc/src/gen_server.xml @@ -133,19 +133,19 @@ gen_server:abcast -----> Module:handle_cast/2 enter_loop/3,4,5, and the type server_ref() - below. + is an alias to supervisor:sup_name().

- {local,LocalName} + {local,LocalName}

Register the gen_server locally - as LocalName using + as LocalName using register/2.

- {global,GlobalName} + {global,GlobalName}

Register the gen_server process id @@ -154,19 +154,19 @@ gen_server:abcast -----> Module:handle_cast/2 global:register_name/2.

- {via,RegMod,ViaName} + {via,RegMod,ViaName}

Register the gen_server process with the registry - represented by RegMod. - The RegMod callback is to export + represented by RegMod. + The RegMod callback is to export the functions register_name/2, unregister_name/1, whereis_name/1, and send/2, which are to behave like the corresponding functions in global. - Thus, {via,global,GlobalName} + Thus, {via,global,GlobalName} is a valid reference equivalent to - {global,GlobalName}. + {global,GlobalName}.

@@ -197,42 +197,42 @@ gen_server:abcast -----> Module:handle_cast/2 The gen_server's process identifier.

- LocalName + LocalName

The gen_server is locally registered - as LocalName with + as LocalName with register/2.

- {Name,Node} + {Name,Node}

The gen_server is locally registered on another node.

- {global,GlobalName} + {global,GlobalName}

The gen_server is globally registered in global.

- {via,RegMod,ViaName} + {via,RegMod,ViaName}

The gen_server is registered in an alternative process registry. - The registry callback module RegMod + The registry callback module RegMod is to export functions register_name/2, unregister_name/1, whereis_name/1, and send/2, which are to behave like the corresponding functions in global. - Thus, {via,global,GlobalName} - is the same as {global,GlobalName}. + Thus, {via,global,GlobalName} + is the same as {global,GlobalName}.

@@ -248,7 +248,7 @@ gen_server:abcast -----> Module:handle_cast/2 start_link/3,4.

- {timeout,Timeout} + {timeout,Timeout}

How many milliseconds the gen_server process is allowed @@ -257,11 +257,11 @@ gen_server:abcast -----> Module:handle_cast/2

- {spawn_opt,SpawnOptions} + {spawn_opt,SpawnOptions}

- The SpawnOptions option list + The SpawnOptions option list is passed to the function used to spawn the gen_server; see @@ -298,7 +298,7 @@ gen_server:abcast -----> Module:handle_cast/2 start_link/3,4.

- {hibernate_after,HibernateAfterTimeout} + {hibernate_after,HibernateAfterTimeout}

Specifies that the gen_server process awaits @@ -309,10 +309,10 @@ gen_server:abcast -----> Module:handle_cast/2 proc_lib:hibernate/3).

- {debug,Dbgs} + {debug,Dbgs}

- For every entry in Dbgs, + For every entry in Dbgs, the corresponding function in sys(3) is called.

diff --git a/lib/stdlib/src/gen_server.erl b/lib/stdlib/src/gen_server.erl index c574f2aeb2bf..8d930883fe9c 100644 --- a/lib/stdlib/src/gen_server.erl +++ b/lib/stdlib/src/gen_server.erl @@ -128,6 +128,7 @@ reply_tag/0, request_id/0, request_id_collection/0, + response_timeout/0, format_status/0]). -export_type( @@ -246,25 +247,16 @@ %%% ----------------------------------------------------------------- -type server_name() :: % Duplicate of gen:emgr_name() - {'local', LocalName :: atom()} - | {'global', GlobalName :: term()} - | {'via', RegMod :: module(), ViaName :: term()}. - --type server_ref() :: % What gen:call/3,4 and gen:stop/1,3 accepts - pid() - | (LocalName :: atom()) - | {Name :: atom(), Node :: atom()} - | {'global', GlobalName :: term()} - | {'via', RegMod :: module(), ViaName :: term()}. - --type start_opt() :: % Duplicate of gen:option() - {'timeout', Timeout :: timeout()} - | {'spawn_opt', SpawnOptions :: [proc_lib:spawn_option()]} - | enter_loop_opt(). + proc_lib:sup_name(). + +% What gen:call/3,4 and gen:stop/1,3 accepts +-type server_ref() :: proc_lib:sup_ref(). + +% Duplicate of gen:option() +-type start_opt() :: proc_lib:option(). %% --type enter_loop_opt() :: % Some gen:option()s works for enter_loop/* - {'hibernate_after', HibernateAfterTimeout :: timeout()} - | {'debug', Dbgs :: [sys:debug_option()]}. +% Some gen:option()s works for enter_loop/* +-type enter_loop_opt() :: proc_lib:enter_loop_opt(). -type start_ret() :: % gen:start_ret() without monitor return {'ok', Pid :: pid()}