March 2020
Intermediate to advanced
328 pages
7h 58m
English
Elixir is a parallel execution machine. Each Channel can leverage the principles of OTP design to execute work in parallel with other Channels, since the BEAM executes multiple processes at once. Every message processed by a Channel, whether incoming or outgoing, must go through the Channel process in order to execute. It’s possible for this to stop working well if we’re not careful about how our Channel is designed. This is easiest to see when we have an example of the problem in front of us.
We’ll leverage our existing StatsChannel to see the effect of process slowness. Let’s add a new message handler that responds very slowly.
| | def handle_in( |
Read now
Unlock full access