[erlang-questions] Message delivery in case of process restart
Fri May 17 14:46:40 CEST 2013
On Fri, May 17, 2013 at 11:09 AM, Jonathan Schneider
> > "Sending a message to a pid never fails, even if the pid
> > identifies a non-existing process."
> The documentation could be clearer. It means never causes an error for the
Yes - *sending* messages always works if you have a valid Pid. This does
not mean that
*receiving* the message succeeds.
Suppose the Pid refers to a process on a remote machine. When you send the
remote process might exist. But the remote machine might die while the
message is in transit
between the machines.
Failure of a remote process can be detected by linking to the process. If
the process you have linked to
dies you'll be send an exit signal.
Receiving a message is a somewhat vague idea. When you send a message to a
it gets put in the mailbox of the receiving processes (assuming the
receiving process has not died).
The word "receiving" might mean "put in the receives mailbox" or "evaluates
one of the receive
clauses in a receive statement."
If you want to really know that a message was received and acted upon, you
need to send a confirmation
message back the the sender, when you get this message you'll know that the
processed by the receiver. If you also link to the process you'll get an
error signal back if the process fails.
So basically you link to the remote process, send it a message and you'll
either get a reply
or an exit signal back.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions