The Child Specification

Understand the details of child specifications.

The strategies describe a lot of how a supervisor works with child processes, but they are not the whole story. There are a number of other options we can specify. Those options are stored in the child specification.

Fortunately, we don’t have too much work to do here. The GenServer Behaviour creates a default child specification for us whenever we add the use GenServer line to a module.

New IEx session

We can check the child spec for the Game module in IEx with child_spec/1, and pass it the argument we want the supervisor to use as it starts a game.

Get hands-on with 1400+ tech skills courses.