OTP, State, and the Functional Core
An introduction to the OTP GenServer along with some tips on using your functional core.
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 ...