Remote procedure calls invoke functions on other nodes while returning a result to the caller. They help distribute load and preserve service when nodes fail. section 12.0 section 12.1.5
Use RPC when a fire-and-forget process operation is not sufficient:
- Call :rpc.call/4 with a target node and MFA to execute a function remotely and obtain its result. section 12.1.5
- Invoke functions across multiple nodes and collect their results when coordinating cluster-wide work such as replication. section 12.1.5
- Treat message passing, copied message contents, delivery uncertainty, and response protocols as part of the communication design. section 12.0
The :rpc service builds on transparent message passing: it sends an MFA to each node’s registered :rex process, applies the function, and returns the response. section 12.1.5
iex(node1@localhost)1> :rpc.call(:node2@localhost, Kernel, :abs, [-1]) 1
A minimal IEx call invokes Kernel.abs(-1) on node2 and returns 1 to node1. section 12.1.5




