#Supervision
4 notas · última:
Building Distributed Systems in Elixir: Part 5 — Supervisor From Scratch
The article builds a manual one-for-one supervisor in Elixir using links, trapped exits, and message passing to restart only a crashed worker while leaving a healthy sibling running.
Building Distributed Systems in Elixir: Part 4 — Process Linking
The article explains how `spawn_link/1` connects two BEAM processes so an abnormal exit in one can terminate the other, and how `Process.flag(:trap_exit, true)` turns that exit into a message.
Monitoring WebSocket disconnections in Phoenix
The post shows how to run cleanup code when a Phoenix WebSocket closes by spawning monitored tasks, placing the tasks supervisor before the endpoint, and using a small init/1 trick to capture the socket process.
[elixir-talk:7975] A question about global state
The thread explains that Elixir libraries can keep startup-derived state in a supervised process or ETS, and that users should start it through the application rather than manually.
