distribute
Facade for common distributed operations.
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 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 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 subscribe(
user_subject: process.Subject(monitor.ClusterEvent),
) -> Result(
process.Subject(monitor.ControlMessage),
actor.StartError,
)
pub fn unregister(
name: String,
) -> Result(Nil, registry.RegisterError)
pub fn unsubscribe(
monitor_subject: process.Subject(monitor.ControlMessage),
) -> Nil