Implementing a Supervisor
So far we have used two types of supervisors—Task.Supervisor and DynamicSupervisor. They’re great because they allow you to start processes on demand. However, they are both made with a specific goal in mind, and sometimes you will need greater configurability over how the supervisor works.
This is why you will often reach for the Supervisor behaviour to create your own supervisor from scratch. In this section, we will create a supervisor using the Supervisor behaviour, and put it in front of each Job process.
We already learned supervisors can restart child processes, and we saw how the :permanent and :transient restart values work. The last setting we haven’t used is :temporary. This value tells the supervisor to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access