Remote Message Passing

Discover how nodes can interact with each other for communication and try it in this lesson.

Nodes in Elixir

Throughout this course, we’ve been addressing Elixir adoption, one layer at a time. We started with functions and walked through how to organize code and think functionally. Next, we moved into concurrency. In Elixir, the fundamental constructs for concurrency are processes, and the OTP abstraction is built upon them. We talked about building layered applications and a structure for sending messages between them.

Now, we’ll introduce the concept of nodes. A node is an abstract group of processes. They may be running on the same machine or different ones. When using Elixir, we send messages between remote processes and local processes in exactly the same way. That means processes form the foundation of distributed applications. Elixir uses the same send/2 function for sending messages to processes running on the same node or on a separate node over the network. Throughout this chapter, we’re going to set up some nodes and do exactly that.

Get hands-on with 1200+ tech skills courses.