gleam/erlang/node
Multiple Erlang VM instances can form a cluster to make a distributed Erlang system, talking directly to each other using messages rather than other communication protocols like HTTP. In a distributed Erlang system each virtual machine is called a node. This module provides Node related types and functions to be used as a foundation by other packages providing more specialised functionality.
For more information on distributed Erlang systems see the Erlang documentation: https://www.erlang.org/doc/system/distributed.html.
Types
pub type ConnectError {
FailedToConnect
LocalNodeIsNotAlive
}
Constructors
-
FailedToConnect
Was unable to connect to the node.
-
LocalNodeIsNotAlive
The local node is not alive, so it is not possible to connect to the other node.
Values
pub fn connect(node: atom.Atom) -> Result(Node, ConnectError)
Establish a connection to a node, so the nodes can send messages to each other and any other connected nodes.
Returns Error(FailedToConnect)
if the node is not reachable.
Returns Error(LocalNodeIsNotAlive)
if the local node is not alive, meaning
it is not running in distributed mode.