Slide 98
Slide 98 text
Scaling Elixir: Distributing Work
Example: The Swarm Worker prefers to die quickly
def handle_info({:swarm, :die}, state), do:
{:stop, :shutdown, state}
def handle_info({:DOWN, ref, :process, _, _}, {_, _, ref} = state), do:
{:stop, :shutdown, state}
def handle_info({:EXIT, _, _}, _), do:
Process.exit(self(), :kill)