Node
Functions related to VM nodes.
Some of the functions in this module are inlined by the compiler,
similar to functions in the Kernel module and they are explicitly
marked in their docs as "inlined by the compiler". For more information
about inlined functions, check out the Kernel module.
Summary
| alive?() | Returns |
| connect(node) | Establishes a connection to |
| disconnect(node) | Forces the disconnection of a node. This will appear to the |
| get_cookie() | Returns the magic cookie of the local node, if the node is alive;
otherwise |
| list() | Returns a list of all visible nodes in the system, excluding
the local node. Same as |
| list(args) | Returns a list of nodes according to argument given. The result returned when the argument is a list, is the list of nodes satisfying the disjunction(s) of the list elements |
| monitor(node, flag) | Monitors the status of the node. If |
| monitor(node, flag, options) | Behaves as |
| self() | Returns the current node. It returns the same as the built-in |
| set_cookie(node \\ Node.self(), cookie) | Sets the magic cookie of |
| spawn(node, fun) | Returns the pid of a new process started by the application of |
| spawn(node, fun, opts) | Returns the pid of a new process started by the application of |
| spawn(node, module, fun, args) | Returns the pid of a new process started by the application of
|
| spawn(node, module, fun, args, opts) | Returns the pid of a new process started by the application of
|
| spawn_link(node, fun) | Returns the pid of a new process started by the application of |
| spawn_link(node, module, fun, args) | Returns the pid of a new process started by the application of
|
Functions
Specs:
- alive? :: boolean
Returns true if the local node is alive; that is, if the node can be
part of a distributed system. Otherwise, it returns false.
Specs:
- connect(t) :: boolean | :ignored
Establishes a connection to node. Returns true if successful,
false if not, and the atom :ignored if the local node is not
alive.
See http://erlang.org/doc/man/net_kernel.html#connect_node-1 for more info.
Specs:
- disconnect(t) :: boolean | :ignored
Forces the disconnection of a node. This will appear to the node as if
the local node has crashed. This BIF is mainly used in the Erlang network
authentication protocols. Returns true if disconnection succeeds, otherwise
false. If the local node is not alive, the function returns :ignored.
See http://www.erlang.org/doc/man/erlang.html#disconnect_node-1 for more info.
Returns the magic cookie of the local node, if the node is alive;
otherwise :nocookie.
Specs:
- list :: [t]
Returns a list of all visible nodes in the system, excluding
the local node. Same as list(:visible).
Specs:
- list(list_arg | [list_arg]) :: [t]
Returns a list of nodes according to argument given. The result returned when the argument is a list, is the list of nodes satisfying the disjunction(s) of the list elements.
See http://www.erlang.org/doc/man/erlang.html#nodes-1 for more info.
Specs:
- monitor(t, boolean) :: true
Monitors the status of the node. If flag is true, monitoring is
turned on. If flag is false, monitoring is turned off.
See http://www.erlang.org/doc/man/erlang.html#monitor_node-2 for more info.
Specs:
- monitor(t, boolean, [:allow_passive_connect]) :: true
Behaves as monitor/2 except that it allows an extra
option to be given, namely :allow_passive_connect.
See http://www.erlang.org/doc/man/erlang.html#monitor_node-3 for more info.
Sets the magic cookie of node to the atom cookie. The default node
is Node.self, the local node. If node is the local node, the function also
sets the cookie of all other unknown nodes to cookie.
This function will raise FunctionClauseError if the given node is not alive.
Specs:
- spawn(t, (() -> any)) :: pid
Returns the pid of a new process started by the application of fun
on node. If node does not exist, a useless pid is returned.
Check http://www.erlang.org/doc/man/erlang.html#spawn-2 for the list of available options.
Inlined by the compiler.
Specs:
- spawn(t, (() -> any), Process.spawn_opts) :: pid | {pid, reference}
Returns the pid of a new process started by the application of fun
on node. If node does not exist, a useless pid is returned.
Check http://www.erlang.org/doc/man/erlang.html#spawn_opt-3 for the list of available options.
Inlined by the compiler.
Specs:
- spawn(t, module, atom, [any]) :: pid
Returns the pid of a new process started by the application of
module.function(args) on node. If node does not exists,
a useless pid is returned.
Check http://www.erlang.org/doc/man/erlang.html#spawn-4 for the list of available options.
Inlined by the compiler.
Specs:
- spawn(t, module, atom, [any], Process.spawn_opts) :: pid | {pid, reference}
Returns the pid of a new process started by the application of
module.function(args) on node. If node does not exists,
a useless pid is returned.
Check http://www.erlang.org/doc/man/erlang.html#spawn_opt-5 for the list of available options.
Inlined by the compiler.
Specs:
- spawn_link(t, (() -> any)) :: pid
Returns the pid of a new process started by the application of fun
on node. A link is created between the calling process and the
new process, atomically. If node does not exist, a useless pid is returned
(and due to the link, an exit signal with exit reason :noconnection will be
received).
Inlined by the compiler.
Specs:
- spawn_link(t, module, atom, [any]) :: pid
Returns the pid of a new process started by the application of
module.function(args) on node. A link is created between the calling
process and the new process, atomically. If node does not exist, a useless
pid is returned (and due to the link, an exit signal with exit reason
:noconnection will be received).
Inlined by the compiler.