liveBook · Manning

:rex process

As explained in Elixir in Action, Third Edition

:rex is a locally registered Erlang kernel process that receives and executes remote procedure call requests.

:rex is a locally registered Erlang kernel process that underpins remote procedure calls. An RPC request sends an MFA tuple to the target node’s :rex process; :rex invokes apply/3 and returns the result. section 12.1.5

This makes message passing the core distribution primitive: services such as :rpc communicate with processes registered locally on remote nodes rather than requiring a separate transport abstraction. section 12.1.5

iex(node1@localhost)1> :rpc.call(:node2@localhost, Kernel, :abs, [-1])
1

Observe a remote Kernel.abs/1 call through the :rpc interface. section 12.1.5

How Elixir in Action, Third Edition covers it

How deep it goes
Traces RPC from message delivery to apply/3 and response, while deferring implementation details in rpc.erl.
Examples
Demonstrates :rpc.call/4 invoking Kernel.abs/1 on a remote node.
What it assumes
Assumes connected Erlang nodes and familiarity with MFA tuples, registered processes, and message passing.
What you can do after
Evaluate remote functions through :rpc.call/4 across connected Erlang nodes.
How it connects
Connects Erlang distribution, RPC, message passing, local process registration, MFA, and apply/3.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.