Skip to content

Commit ddc9733

Browse files
committed
Add Node.connect/1 method
1 parent 9bcc4be commit ddc9733

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/elixir/lib/node.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ defmodule Node do
7979
:erlang.disconnect_node(node)
8080
end
8181

82+
@doc """
83+
Establishes a connection to Node. Returns true if successful, false if not, and ignored if the local node is not alive.
84+
See http://erlang.org/doc/man/net_kernel.html#connect_node-1 for more info.
85+
"""
86+
@spec connect(t) :: boolean | :ignored
87+
def connect(node) do
88+
:net_kernel.connect_node(node)
89+
end
90+
8291
@doc """
8392
Returns the pid of a new process started by the application of `fun`
8493
on `node`. If `node` does not exist, a useless pid is returned.

0 commit comments

Comments
 (0)