It is used when a process traps exists. Then the :normal
message is transformed into an {:'EXIT', from, :normal}
message which is delivered to the message queue of the process and it can choose to exit itself when it receives it. But if the process is not trapping exists nothing happens. This is different from :kill
and reason
explained below.
You can send any exit reason
to the process. :kill
and :normal
are special. Any other reason has the following behaviour:
- If process is not trapping exists it will exit with
reason
- If process is trapping exists the signal is transformed to
{:'EXIT', from, reason}
and deliver to the message queue
:kill
is an untrappable exit and the process will be killed.
(Mostly stolen from h(Process.exit))