distribute/cluster
Types
Error type for connection failures.
pub type ConnectError {
ConnectTimeout
NodeNotFound
ConnectNetworkError(String)
ConnectIgnored
}
Constructors
-
ConnectTimeoutConnection timed out.
-
NodeNotFoundNode not found or unreachable.
-
ConnectNetworkError(String)Network connectivity issue.
-
ConnectIgnoredConnection was ignored (already connected or self).
pub type StartError {
InvalidNodeName(String)
AlreadyStarted
CookieTooLong
NetworkError(String)
SystemError(String)
StartFailed(String)
}
Constructors
-
InvalidNodeName(String)Node name is invalid (must contain ‘@’ and be a valid atom).
-
AlreadyStartedNode is already started as a distributed node.
-
CookieTooLongCookie is too long (max 255 characters).
-
NetworkError(String)Network-related error (e.g., port binding failure).
-
SystemError(String)Permission denied or other system error.
-
StartFailed(String)Generic startup failure with detailed reason.
Values
pub fn connect(node: String) -> Result(Nil, ConnectError)
Connect to another distributed node. Returns Ok(Nil) if connected, Error with reason otherwise.
pub fn connect_bool(node: String) -> Bool
Connect to another distributed node (legacy API). Returns True if connected successfully, False otherwise. @deprecated Use connect() which returns Result instead
pub fn ping(node: String) -> Bool
Ping a remote node to check if it is reachable. Returns True if the node responds with pong, False otherwise.
pub fn start_node(
name: String,
cookie: String,
) -> Result(Nil, StartError)
Start distributed node with the given name and cookie. Returns Ok(Nil) on success, Error with specific failure reason.