Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priority Messages #9269

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bootstrap/lib/kernel/include/dist.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
-define(DFLAG_NAME_ME, (16#02 bsl 32)).
-define(DFLAG_V4_NC, (16#04 bsl 32)).
-define(DFLAG_ALIAS, (16#08 bsl 32)).
-define(DFLAG_LOCAL_EXT, (16#10 bsl 32)). %% only used internally
-define(DFLAG_ALTACT_MSG, (16#20 bsl 32)).

%% The following flags are mandatory in OTP 25. OTP 25 and higher
%% will accept ?DFLAG_MANDATORY_25_DIGEST as a shorthand for all those
Expand Down
32 changes: 32 additions & 0 deletions erts/doc/guides/erl_dist_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,12 @@ following capability flags are defined:
[`ALIAS_SEND_TT`](erl_dist_protocol.md#ALIAS_SEND_TT) control messages.
Introduced in OTP 24.

- **`-define(DFLAG_ALTACT_MSG, (1 bsl 37)).`{: #DFLAG_ALTACT_MSG }** - The node
supports alternate action messages (alias and priority messages) and can by
this handle the
[`ALTACT_MSG_SEND`](erl_dist_protocol.md#ALTACT_MSG_SEND) control messages.
Introduced in OTP 28.

There is also function `dist_util:strict_order_flags/0` returning all flags
(bitwise or:ed together) corresponding to features that require strict ordering
of data over distribution channels.
Expand Down Expand Up @@ -1148,6 +1154,32 @@ distributed operation it encodes:
Same as [`ALIAS_SEND`](erl_dist_protocol.md#ALIAS_SEND), but also with a
sequential trace `Token`.

### New Ctrlmessages for Erlang/OTP 28

- **`ALTACT_MSG_SEND`{: #ALTACT_MSG_SEND }** - `{37, Flags, SenderPid, To}` or `{37, Flags, SenderPid, To, Token}`

Followed by `Message`.

This control message is used when sending an alternate action message signal
`Message` to the process identified by `To`. Currently defined alternate
action message signals are alias and priority message signals. That is,
message signals with an action upon reception which is different than the
default action to append the message to the message queue.

Currently the following bitwise flags are defined:
* `ALTACT_MSG_FLG_PRIO` - **`1`** - This is a priority message
* `ALTACT_MSG_FLG_TOKEN` - **`2`** - The control message is a 5-tuple with
token as element 5; otherwise, the control message is a 4-tuple.
* `ALTACT_MSG_FLG_ALIAS` - **`4`** - Send to an alias, i.e., `To` is a reference
* `ALTACT_MSG_FLG_NAME` - **`8`** - Send to a registered name, i.e., `To` is an atom

If neither `ALTACT_MSG_ALIAS` nor `ALTACT_MSG_NAME` is set, `To` is a process
identifier.

Nodes that can handle this control message sets the distribution flag
[`DFLAG_ALTACT_MSG`](erl_dist_protocol.md#dflags) in the connection setup
handshake.

[](){: #link_protocol } [](){: #new_link_protocol } [](){: #old_link_protocol }

### Link Protocol
Expand Down
8 changes: 8 additions & 0 deletions erts/emulator/beam/atom.names
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ atom exact_reductions
atom exception_from
atom exception_trace
atom exclusive
atom exit_message
atom exit_status
atom exited
atom existing
Expand Down Expand Up @@ -424,6 +425,7 @@ atom Lt='<'
atom machine
atom magic_ref
atom major
atom marked_message
atom match
atom match_limit
atom match_limit_recursion
Expand Down Expand Up @@ -460,6 +462,7 @@ atom module
atom module_info
atom monitored_by
atom monitor
atom monitor_message
atom monitor_nodes
atom monitors
atom monotonic
Expand Down Expand Up @@ -571,6 +574,10 @@ atom prepare
atom prepare_on_load
atom print
atom priority
atom priority_exit_message
atom priority_marked_message
atom priority_messages
atom priority_monitor_message
atom private
atom private_append
atom process
Expand Down Expand Up @@ -704,6 +711,7 @@ atom suspending
atom system
atom system_flag_scheduler_wall_time
atom system_limit
atom system_monitor
atom system_version
atom system_architecture
atom table
Expand Down
Loading