O'Reilly logo

Elixir Cookbook by Paulo A Pereira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a supervisor

One of the main advantages of Elixir is fault tolerance, and one of the underlying philosophies is the famous let it crash philosophy. This means that by principle, no defensive programming is performed. You write the code that expresses your intent and handles the case you are expecting, and then if something goes wrong, you just let the process crash.

There are mechanisms in Elixir that allow the monitoring of processes and even give you the ability to relaunch a process (or a group of processes) if something goes wrong.

Probably in case of programming errors, this doesn't make sense, but what if the error was due to something that's external to your program? What if the program is logically sound, and everything is working ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required