aarondb/cluster_transport

cluster_transport — correlation-safe remote bridge for cluster runtimes

cluster_runtime.Runtime is a local Gleam actor capability. It cannot be reconstructed from a remote BEAM PID because Gleam deliberately tags subjects. This module keeps that capability boundary intact: it exposes a separate remote handle and sends each request with a reply Subject created by the caller, preserving Gleam’s actor capability tag across the wire.

The bridge has no TCP fallback. Cross-node calls require an already connected BEAM distribution channel; operators must configure authenticated TLS distribution before a remote handle is admitted.

Types

pub opaque type RemoteRuntime

Values

pub fn connect(
  cluster: String,
  node: String,
) -> Result(RemoteRuntime, cluster_runtime.Error)
pub fn elect(
  runtime: RemoteRuntime,
  granted_votes: Int,
  deadline_ms: Int,
) -> Result(Nil, cluster_runtime.Error)
pub fn inspect(
  runtime: RemoteRuntime,
  deadline_ms: Int,
) -> Result(cluster_runtime.Snapshot, cluster_runtime.Error)
pub fn join(
  runtime: RemoteRuntime,
  peer: cluster_runtime.Peer,
  deadline_ms: Int,
) -> Result(Nil, cluster_runtime.Error)
pub fn receive(
  runtime: RemoteRuntime,
  frame: cluster_runtime.Frame,
  deadline_ms: Int,
) -> Result(raft_runtime.Reply, cluster_runtime.Error)
pub fn replicate(
  runtime: RemoteRuntime,
  command: String,
  deadline_ms: Int,
) -> Result(Int, cluster_runtime.Error)
pub fn shutdown(
  runtime: RemoteRuntime,
  deadline_ms: Int,
) -> Result(Nil, cluster_runtime.Error)
Search Document