title: Elixir Processes Monitoring: :EXIT vs :DOWN
body: <p>I usually see examples of process monitoring where the code for handling a monitored process exit is the following:</p>
  
  <pre><code>handle_info({:DOWN, ref, :process, pid}, state)
  </code></pre>
  
  <p>But I have also seen examples where they are matching an <code>:EXIT</code> instead of a <code>:DOWN</code> message.</p>
  
  <p>So far, I have only been able to trigger <code>:DOWN</code> messages in my own examples, which includes standard <code>Process.exit</code> and <code>GenServer.stop</code> messages, as well as raising an exception in the monitored process.</p>
  
  <p>When will I receive an <code>:EXIT</code> message?</p>