Demand-Driven Processing
We have already seen how Elixir is especially suited to spawning million of processes. This capability lets the developer easily run simultaneous execution flows, only capped by the number of available processors on the machine.
Nevertheless, all this power may not be sufficient if a huge amount of data continuously flows to your application. If you don't process it fast enough, the message boxes of your processes will start to pile up and eventually use all your memory, bringing your application to a halt.
In this chapter we'll analyze how Elixir tackles this problem by controlling the rate at which data is processed with the recently introduced GenStage behaviour. Later on, we'll apply this behaviour to the ElixirDrip ...
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.
Read now
Unlock full access