In this recipe, we will implement a simple server that will store pairs of values (IP and UUID).This might be used, for instance, to store users of a system who are currently connected.
In this recipe, we will only store the provided information and respond to requests on whether a user with a given IP is connected or not.
We will implement a server using the OTP-defined GenServer behavior. We will need to implement the
init functions and some callbacks to handle the messages our server receives (
handle_cast). To make the interaction with the server more pleasant, we will create some wrappers around the callbacks creating a client API.
The GenServer-defined behavior enforces ...