OTP, State, and the Functional Core
Explore how the OTP GenServer manages state using recursion and message passing within Elixir's functional core. Understand the separation between business logic and concurrency, and learn to build scalable, resilient projects by layering processes and modular code management.
We'll cover the following...
The OTP GenServer
We built some boilerplate to use recursion and message passing to manage the state. The OTP GenServer does precisely that. It creates a process and loops over some state. Then other processes can modify that state by sending the GenServer messages.
In Elixir, OTP uses the magic of macros and functions to make all of this available with little ceremony: the recursive loop, the message passing, and more. They hide many of the messy details from you. It gives the user control of the ...