Search⌘ K
AI Features

Meet the Supervisor

Explore the role of supervisors in Elixir to manage child processes safely and efficiently. Discover how supervision trees isolate errors and maintain fault tolerance for your concurrent programs using built-in modules like Task.Supervisor.

We'll cover the following...

Supervisor

Just like the workplace, where supervisors are held responsible for groups of employees, Elixir supervisors are responsible for the processes assigned to them. Subordinate processes report back to their supervisor to ensure everything runs smoothly. To accomplish this, supervisors come with a set of features that allow them to manage other processes effectively.

  • They can start processes.

  • They can stop processes.

  • They can restart processes in the case of unforeseen system errors.

  • Supervisors are configured to trap exits, so when a supervised process exits with an error, that error will be isolated. Therefore, it won’t propagate further.

All this makes supervisors an important ...