- Why receive expression is sometimes called selective receive?
- What is the "save queue"?
- How the after section works?
相关问题
- Is “new” in Erlang part of the official standard a
- how to create a keep-alive process in Erlang
- Convert a map into a keyword list in Elixir
- Understanding pattern matching in Elixir function
- ejabberd and Erlang installation with lager_transf
相关文章
- Macro expansion in elixir: how to define 2 macros
- Chunking list based on struct type changing
- How do I modify a record in erlang?
- Check active timers in Erlang
- How to get data from Ecto in a custom mix task
- Elixir case on a single line
- undefined function maps:to_json/1
- How do you embed double-quotes an Elixir string?
In the erlang shell:
Note how there was no output for the first message that was sent, but there was output for the second message that was sent. The receive was selective: it did not receive all messages, it received only messages matching the specified pattern.
In the erlang shell:
In the erlang shell:
Another example:
In the erlang shell:
There is a special "save queue" involved in the procedure that when you first encounter the receive expression you may ignore its presence.
Optionally, there may be an after-section in the expression that complicates the procedure a little.
The receive expression is best explained with a flowchart: