0PricingLogin
Erlang OTP: Distributed & Fault-Tolerant Systems Programming · Lesson

Remote Procedure Calls (RPC)

Execute functions on remote nodes using RPC, enabling distributed computation and service invocation across a cluster.

What is Remote Procedure Call?

Imagine you have two Erlang programs running on different machines, or even on the same machine but in separate Erlang "nodes." How do they talk?

Remote Procedure Call (RPC) is a way for one program (the client) to ask another program (the server) to execute a function, just like it would call a local function. The client doesn't need to know the details of network communication.

Erlang's Built-in RPC Module

Erlang makes distributed computing easy with its built-in rpc module. This module provides functions to call or cast computations on remote Erlang nodes.

  • rpc:call/4: For synchronous calls, meaning the client waits for a reply.
  • rpc:cast/4: For asynchronous calls, where the client doesn't wait for a reply.

These are powerful tools for building distributed applications.

All lessons in this course

  1. Node Communication & Setup
  2. Remote Procedure Calls (RPC)
  3. Global Process Registration
  4. Distribution Security & Cookies
← Back to Erlang OTP: Distributed & Fault-Tolerant Systems Programming