GenServers are everywhere in Elixir code. Becoming proficient with GenServer is one of the best things you can do to level up as an Elixir developer. It will require some work on your part. You’ll need to learn how client functions, module functions, and callbacks work and interact.
But honestly, implementing a GenServer is pretty straightforward. We’ll get lots of practice in this chapter, so you’ll come out of it knowing your way around.
Let’s begin with a new file in the lib directory called lib/islands_engine/game.ex. This will define a new module that will become our GenServer.
|||defmodule IslandsEngine.Game do|
By adding the use GenServer line, we already have the beginnings of ...