Minimizing error effects with supervision trees

In the previous section, we worked with supervisors and observed how they enable error-recovery. They're crucial components when building fault-tolerant applications, and they significantly change the mindset from the prevalent error-recovery mechanisms, such as try/catch. Having seen how we can use supervisors to detect and recover from runtime errors, we'll now focus on how we can combine them, creating supervision trees, to have fine-grained error recovery in our applications, reducing the effect of an error on the overall system.

To build a supervision tree, you must consider the effects on the rest of the system when a certain processes terminates due to an error. This way, you'll group ...

Get Mastering Elixir 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.