OxL Reference

method ClusterApi.on

Calls handler(member) when the membership changes in the way event names (polled twice a second; changes that happened before the call are not reported).

Example:

oxl✓ checked in CI
fn watch() io, time {
  cluster.on(ClusterEvent.MemberLeft, (m: ClusterMember) => print("{m.id.name} left"))
}
pub(api) fn on<effect F>(event: ClusterEvent, handler: fn(ClusterMember) F)

Since. 1.0.0-beta

Parameters

NameType
eventClusterEvent
handlerfn(ClusterMember) F

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/node.oxl:571

See also