The model - what is a supervisor?

A Supervisor is in charge of managing the various child processes that may be a part of your larger Application. The Supervisor is where the list of children is managed, as well as the strategies for dealing with what happens when one of those child processes decides to break down during the course of your application getting work done.

The Supervisor typically provides an initialization function and can perform a few other random functions, such as being able to look up a child process and report back on data about that child process when necessary. If we were to think about Elixir projects in terms of a hierarchy, it would look something like this:

We'll talk a little bit more about the remaining parts ...

Get Phoenix Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.