[erlang-questions] Erlang basic doubts about String, message passing and context switching overhead
Tue Jan 10 21:48:31 CET 2017
On 01/10/2017 12:03 PM, Hugo Mills wrote:
> This is the "receive" expression. It runs a set of matches against
> the mailbox and returns the first matching message.
I think of receive as being similar to select(2). You have a data source
you're interested in pulling data from (your mailbox), and you can
choose to either wait up to a certain amount of time for new data
(receive ... after T ...) or you can block your process until new data
appears. Of course -as you mention- receive lets you pattern match on
messages, so you aren't forced to process messages that are not of interest.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the erlang-questions