Skip to content

Instantly share code, notes, and snippets.

@adolfont
Last active October 9, 2024 17:30
Show Gist options
  • Save adolfont/646eddac6cdcdbc4e55e0fa4e84c58f1 to your computer and use it in GitHub Desktop.
Save adolfont/646eddac6cdcdbc4e55e0fa4e84c58f1 to your computer and use it in GitHub Desktop.

Commmunicating Processes - The Receiver

1. What is the name of this node?

Node.self()

You will have to add the name of this node to the other notebook.

4. Identifying the Sender Node

# sender_node  = "<PUT HERE SOMETHING LIKE   :"livebook_7louvomv--3732fjg3@127.0.0.1"   FROM THE OTHER NOTEBOOK >"

sender_node  = <>

5. Connecting to other node

Node.connect(sender_node)

6. Creating a process

pid = spawn(fn -> receive do msg -> IO.inspect(msg) end end)

7. Registering a process

Process.register(pid, :receiver)

8. Receiving a message

IO.puts "Waiting"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment