Archive for September, 2007

Erlang: How to send a message to a registered process on another node

Saturday, September 29th, 2007

It took me ages to find out how to do this — it is such a simple thing that no-one ever seems to mention it. Assuming that you have a process registered to foo:

register(foo, Pid).

you send it a message from the current node by doing:

foo ! "hello".

and you send it a message from another node by doing:

{ foo, node_name@othernode } ! "hello".