Links
- Links. A link ties two processes: if one dies abnormally, the other dies too, by default.
- Bidirectional. Links are bidirectional: either side’s crash propagates to the other.
- Why links exist. Links guarantee cleanup: a worker cannot outlive the request that owned it.
Monitors
- Monitors. A monitor watches one-way: the watcher receives a DOWN message when the target dies.
- DOWN messages. The DOWN message carries pid and reason: death as data, handled in receive.
- Links versus monitors. Link when fates are shared; monitor when you only need to know: two tools, two contracts.
Exit Signals and Failure Propagation
- Exit signals. A dying process sends exit signals along its links: reason normal is quiet, others propagate.
- trap_exit. A process trapping exits turns signals into messages: the mechanism supervisors are built on.
- Failure as design material. Erlang treats failure as data: propagated, observed and answered, never hidden.
Before and after this level
- Before: Level 4: Processes: Lightweight Processes, Message Passing, Mailboxes and Receive.
- Next: Level 6: OTP Foundations: Behaviours, GenServer, Standardising Concurrent Components.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Erlang Level 5: Process Relationships cover?
Links, Monitors, Exit Signals and Failure Propagation: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 4: Processes, which covers Lightweight Processes, Message Passing, Mailboxes and Receive.