Skip to Main Content
Mastering Elixir
book

Mastering Elixir

by André Albuquerque, Daniel Caixinha
July 2018
Intermediate to advanced content levelIntermediate to advanced
574 pages
14h 7m
English
Packt Publishing
Content preview from Mastering Elixir

Message passing between processes

After the initial contact with Elixir, when we start building applications with some degree of complexity, we frequently need our concurrent processes to cooperate with one another. As we've previously stated, processeses don't share memorythey communicate by passing messages back and forth. These messages contain Elixir termsbasically anything you can store in a variable can be sent in a message.

The sending of the message consists of storing it in the receiver's mailbox. The mailbox of a process is unboundedhowever, in practice, it is bounded by the available memory. Let's now see this in action, by sending a message to ourselves in the shell process. To send a message, you use the Kernel.send/2 function, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781788472678Supplemental Content