Links and Monitors Explained
Differentiate between links and monitors, understanding their roles in process supervision and propagating exit signals.
Introduction to Process Faults
Erlang processes are designed to be isolated. But what happens when one process crashes? How do other processes know, and how can they react?
Understanding how failures propagate is key to building fault-tolerant systems in Erlang. This lesson introduces two fundamental mechanisms: links and monitors.
Process Linking Explained
A link is a bidirectional connection between two Erlang processes. It's like holding hands: if one process goes down (exits), it sends an exit signal to all linked processes.
- Links are created with
spawn_link/1,2,3,4. - If a process linked to another process exits normally, the exit signal is
normal. - If it exits with an error, the exit signal carries the reason for the crash.
All lessons in this course
- Links and Monitors Explained
- Robust Error Handling
- Designing for Crash-First
- The Let-It-Crash Philosophy