Chapter 5. Concurrent error-handling and fault tolerance with links, monitors, and processes

This chapter covers

  • Handling errors, Elixir style
  • Links, monitors, and trapping exits
  • Implementing a supervisor

Ever watched The Terminator, the movie about an assassin cyborg from the future (played by Arnold Schwarzenegger)? Even when the Terminator is shot multiple times, it just keeps coming back unfazed, over and over again. Once you’re acquainted with Elixir’s fault-tolerance features, you’ll be able to build programs that can handle errors gracefully and take corrective actions to fix the problems. (You won’t be able to build Skynet, though—at least, not yet.)

In sequential programs, there’s typically only one main process doing all the hard ...

Get The Little Elixir & OTP Guidebook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.