...

/

Implement a Supervisor

Implement a Supervisor

Learn to make our supervisor from scratch and add it to our project.

So far, we have used two types of supervisors—Task.Supervisor and DynamicSupervisor. They’re great because they allow us to start processes on demand. However, they are both made with a specific goal in mind, and sometimes we need greater configurability over how the supervisor works.

Implement a Supervisor from scratch

We will often opt for the Supervisor behaviour to create a supervisor from scratch. In this section, we create a supervisor using the Supervisor behaviour and put it in front of each Job process.

We already learned that supervisors could restart child processes and saw how the :permanent and :transient restart values work. The ...