Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
2151-Introduce-exported-erlang-send_destination...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2151-Introduce-exported-erlang-send_destination-0-type.patch of Package erlang
From ddeffc2db960e11f9675fc7b7cea68e1da4337bb Mon Sep 17 00:00:00 2001 From: Per Gustafsson <pergu@fb.com> Date: Fri, 11 Dec 2020 15:40:27 +0000 Subject: [PATCH 1/2] Introduce exported erlang:send_destination/0 type --- erts/doc/src/erlang.xml | 18 ++++++++++-------- erts/preloaded/src/erlang.erl | 23 +++++++++++++---------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index fffe07e838..4a092102d2 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -552,7 +552,6 @@ MQD)</c></seeerl> </p> </desc> </datatype> - <datatype> <name name="stacktrace" prefix="true"/> <name name="stacktrace_extrainfo" prefix="true"/> @@ -561,7 +560,15 @@ section in the Erlang Reference Manual. </p></desc> </datatype> - + <datatype> + <name name="send_destination" prefix="true"/> + <desc> + <p>The destination for a send operation, can be a remote or local process identifier, + a (local) port, a reference denoting a process alias, a locally registered name, or a tuple + <c>{<anno>RegName</anno>, <anno>Node</anno>}</c> + for a registered name at another node.</p> + </desc> + </datatype> </datatypes> <funcs> @@ -7126,7 +7133,6 @@ true</pre> <func> <name name="send" arity="2" since=""/> <fsummary>Send a message.</fsummary> - <type name="dst"/> <desc> <p>Sends a message and returns <c><anno>Msg</anno></c>. This is the same as using the <seeguide marker="system/reference_manual:expressions#send"> @@ -7134,8 +7140,7 @@ true</pre> <c><anno>Dest</anno> ! <anno>Msg</anno></c>.</p> <p><c><anno>Dest</anno></c> can be a remote or local process identifier, an alias, a (local) port, a locally registered name, or a tuple - <c>{<anno>RegName</anno>, <anno>Node</anno>}</c> - for a registered name at another node.</p> + <c>{RegName, Node}</c> for a registered name at another node.</p> <p>The function fails with a <c>badarg</c> run-time error if <c><anno>Dest</anno></c> is an atom name, but this name is not registered. This is the only case when <c>send</c> fails for an @@ -7146,7 +7151,6 @@ true</pre> <func> <name name="send" arity="3" since=""/> <fsummary>Send a message conditionally.</fsummary> - <type name="dst"/> <desc> <p>Either sends a message and returns <c>ok</c>, or does not send the message but returns something else (see below). @@ -7202,7 +7206,6 @@ true</pre> <func> <name name="send_nosuspend" arity="2" since=""/> <fsummary>Try to send a message without ever blocking.</fsummary> - <type name="dst"/> <desc> <p>The same as <seemfa marker="#send/3"><c>erlang:send(<anno>Dest</anno>, @@ -7252,7 +7255,6 @@ true</pre> <func> <name name="send_nosuspend" arity="3" since=""/> <fsummary>Try to send a message without ever blocking.</fsummary> - <type name="dst"/> <desc> <p>The same as <seemfa marker="#send/3"><c>erlang:send(<anno>Dest</anno>, diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 906ce94219..ea9febc061 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -187,6 +187,9 @@ -type iovec() :: [binary()]. -export_type([iovec/0]). +%% Type for the destination of sends. +-export_type([send_destination/0]). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Native code BIF stubs and their types %% (BIF's actually implemented in this module goes last in the file) @@ -2566,13 +2569,13 @@ process_info(_Pid,_ItemSpec) -> erlang:nif_error(undefined). -spec erlang:send(Dest, Msg) -> Msg when - Dest :: dst(), + Dest :: send_destination(), Msg :: term(). send(_Dest,_Msg) -> erlang:nif_error(undefined). -spec erlang:send(Dest, Msg, Options) -> Res when - Dest :: dst(), + Dest :: send_destination(), Msg :: term(), Options :: [nosuspend | noconnect], Res :: ok | nosuspend | noconnect. @@ -3483,14 +3486,14 @@ fun_info_1([K|Ks], Fun, A) -> end; fun_info_1([], _, A) -> A. --type dst() :: pid() - | reference() - | port() - | (RegName :: atom()) - | {RegName :: atom(), Node :: node()}. +-type send_destination() :: pid() + | reference() + | port() + | (RegName :: atom()) + | {RegName :: atom(), Node :: node()}. -spec erlang:send_nosuspend(Dest, Msg) -> boolean() when - Dest :: dst(), + Dest :: send_destination(), Msg :: term(). send_nosuspend(Pid, Msg) -> try @@ -3500,7 +3503,7 @@ send_nosuspend(Pid, Msg) -> end. -spec erlang:send_nosuspend(Dest, Msg, Options) -> boolean() when - Dest :: dst(), + Dest :: send_destination(), Msg :: term(), Options :: [noconnect]. send_nosuspend(Pid, Msg, Opts) -> @@ -4424,7 +4427,7 @@ gc_info(Ref, N, {OrigColls,OrigRecl}) -> 'not'(_A) -> erlang:nif_error(undefined). --spec erlang:'!'(dst(), term()) -> term(). +-spec erlang:'!'(send_destination(), term()) -> term(). '!'(_Dst, _Msg) -> erlang:nif_error(undefined). -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor