A remote registered process is a BEAM process running on another node and addressable through a name paired with that node’s identity. Message sending works the same way whether the process is local or remote. section 12.1.3 section 12.4
A PID identifies both the process and its node. In a printed PID, a nonzero first number indicates a remote process; Kernel.node/1 can determine its node programmatically. section 12.1.3
Global registration provides a shared name for directing requests to one synchronization process across a cluster:
- Registering a name contacts all nodes and updates their local registration caches. section 12.1.3
- Looking up the name is local and therefore avoids additional network chatter after registration. section 12.1.3
- Use calls rather than casts between nodes, and prepare for netsplit scenarios when connections fail. section 12.4
Registering and finding a remote process
Register {:todo_list, "bob"} on node1 with :global.register_name/2. Attempting the same registration on node2 returns :no; :global.whereis_name/1 on node2 returns node1’s PID.
