Process.exit
exit, go back to Process module for more information.
Specs
Sends an exit signal with the given reason to pid.
The following behaviour applies if reason is any term except :normal
or :kill:
If
pidis not trapping exits,pidwill exit with the givenreason.If
pidis trapping exits, the exit signal is transformed into a message{:EXIT, from, reason}and delivered to the message queue ofpid.
If reason is the atom :normal, pid will not exit (unless pid is
the calling process, in which case it will exit with the reason :normal).
If it is trapping exits, the exit signal is transformed into a message
{:EXIT, from, :normal} and delivered to its message queue.
If reason is the atom :kill, that is if Process.exit(pid, :kill) is called,
an untrappable exit signal is sent to pid which will unconditionally exit
with reason :killed.
Inlined by the compiler.
Examples
Process.exit(pid, :kill)
#=> true