distribute

Facade for common distributed operations: start a node, register actors, send messages, look things up.

Values

pub fn connect(node: String) -> Result(Nil, cluster.ConnectError)
pub fn lookup(
  typed_name: registry.TypedName(msg),
) -> Result(global.GlobalSubject(msg), Nil)
pub fn new_subject(
  encoder: fn(msg) -> Result(BitArray, codec.EncodeError),
  decoder: fn(BitArray) -> Result(msg, codec.DecodeError),
) -> global.GlobalSubject(msg)
pub fn nodes() -> List(String)
pub fn ping(node: String) -> Bool
pub fn receive(
  subject: global.GlobalSubject(msg),
  timeout_ms: Int,
) -> Result(msg, codec.DecodeError)
pub fn register(
  typed_name: registry.TypedName(msg),
  subject: global.GlobalSubject(msg),
) -> Result(Nil, registry.RegisterError)
pub fn self_node() -> String
pub fn send(
  subject: global.GlobalSubject(msg),
  message: msg,
) -> Result(Nil, codec.EncodeError)
pub fn start(
  name: String,
  cookie: String,
) -> Result(Nil, cluster.StartError)
pub fn start_actor(
  typed_name: registry.TypedName(msg),
  initial_state: state,
  handler: fn(msg, state) -> receiver.Next(state),
) -> Result(global.GlobalSubject(msg), actor.StartError)
pub fn unregister(
  name: String,
) -> Result(Nil, registry.RegisterError)
pub fn version() -> String
Search Document