Create a GenServer and Supervisor From Scratch

Create a GenServer and Supervisor From Scratch

A GenServer is an Elixir process that executes code asynchronously and keeps the state consistent. However, GenServers must be restarted if they crash or stop due to unforeseen circumstances. Supervisors are used to resume the GenServer or any other process as soon as it stops.

In the first part of this project, we’ll create a GenServer and make synchronous and asynchronous calls to the server. Further on, we’ll learn how to communicate within the GenServer.

In the second part, we’ll see how supervisors are used to make an application fault-tolerant. Lastly, we’ll learn how to start processes—without user intervention—as soon as the application starts.