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 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.