December 2019
Intermediate to advanced
248 pages
5h 34m
English
Intuitively, you might think that it’s best to use the one-way handle_cast to send messages that don’t need responses. For example, the :add_template message doesn’t really need a response. We just trust that the template was added successfully. If it’s not, something has gone horribly wrong. There’s nothing we can do beyond crashing the server and reporting the reasons for the crash back to the user.
Interestingly, handle_cast is rarely the best option for sending messages. In this section, we’ll look at one of the reasons why. They are called serializability and back pressure. Let’s explore why.
As you probably know, each Elixir process has a message queue. We’ll call it the mailbox. Unlike ...
Read now
Unlock full access