Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Node A:
# iex --sname "nodea"
Process.register self, :iex
# Blocking
receive do
{ :hello, pid } ->
IO.puts "Hello from #{inspect(pid)}"
end
# Node B:
# iex --sname "nodeb"
Node.connect :"nodea@myhostname"
# true
parent = self
Node.spawn_link(:"nodea@myhostname", fn ->
parent <- Process.whereis(:iex)
end)
master = receive do
iex_pid -> iex_pid
end
master <- { :hello, "Hello, Batman"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.