OTP defines several generic behaviours we can use when creating Elixir applications. There is the
GenServer behaviour, the
GenEvent behaviour, and the
:gen_fsm behaviour. All of these behaviours have their foundation in an even more general behaviour of OTP processes.
These behaviours remove some of the tedious work we had to do for handling messages and performing work that we encountered in the previous chapter.
We will start with our discussion on
GenServer, and then move onto more specialized variants.
OTP gives us the basic blueprint for a process that receives messages, processes messages and sends a result back, like any server would.
GenServer really stands for generic or general because it provides ...