glixir/libcluster

Types

pub type ClusterError {
  StartError(String)
  ConfigError(String)
}

Constructors

  • StartError(String)
  • ConfigError(String)

Result types for FFI

pub type ClusterStartResult {
  ClusterStartOk(pid: process.Pid)
  ClusterStartError(reason: String)
}

Constructors

  • ClusterStartOk(pid: process.Pid)
  • ClusterStartError(reason: String)

Clustering strategy types

pub type ClusterStrategy {
  DNSPoll
  Gossip
  Kubernetes
  EPMD
  EC2
}

Constructors

  • DNSPoll
  • Gossip
  • Kubernetes
  • EPMD
  • EC2

Values

pub fn connected_node_names() -> List(String)

Get list of connected node names as strings

pub fn connected_nodes() -> List(atom.Atom)
pub fn current_node_name() -> String

Get current node name as string

pub fn is_clustered() -> Bool

Check if clustering is active (has connected nodes)

pub fn node_name() -> atom.Atom
pub fn start_clustering_dns(
  app_name: String,
  query: String,
  polling_interval: Int,
) -> Result(process.Pid, ClusterError)

Start clustering with DNS poll (most common for production)

pub fn start_clustering_fly(
  app_name: String,
) -> Result(process.Pid, ClusterError)

Start clustering for Fly.io (uses DNS polling automatically)

pub fn start_clustering_local(
  app_name: String,
) -> Result(process.Pid, ClusterError)

Start clustering for local development (uses Gossip)

Search Document