Introduction

Learn how to build a supervisor for the game module.

We'll cover the following...

Game supervision

We all work with computers. We know it’s inevitable that things will go wrong—sometimes really wrong. Despite our best-laid plans, the state goes terrible, and systems raise exceptions while servers crash. These failures often seem to come out of nowhere.

To combat these inevitable problems, we need to boost fault tolerance. We need to isolate failures as much as possible, handle them, and have the system carry on as a whole.

Elixir and OTP provide a world-class mechanism to handle problems and to move on. This mechanism is called process supervision. Process supervision means we can have specialized processes that watch other functions and restart them when they crash.

The mechanism we use to define and spawn these specialized processes is the supervisor.

We’ll now build our supervisor for the Game ...