OxL Справочник OxL
РусскийEnglish

module std.cluster

std.cluster — the node and its cluster (§12.3, single node: D-2906).

Example:

oxl✓ проверяется в CI
use std.cluster

fn main() io {
  let me = cluster.selfInfo()
  print("{me.isSelf} {cluster.members().len()} {cluster.now() < cluster.now()}")
}
Вывод
true 1 true

Функции

leaderRegisters the leader task name (§12.6) and returns at once.
lockRuns body under the distributed lock key (§12.6).
lockFencedLike lock; body receives the fencing token.
membersThe members that are alive or merely suspected (§12.3 cluster.members()).
nodeThe id of the node called name.
nodesAll nodes the membership knows, this one included, with their state ("alive", "suspect", "dead", "left").
nowHybrid logical clock stamp of a new event (§12.6, §17.3).
observeMerges a stamp received from outside the cluster channel; false when it is more than the allowed drift ahead.
selfThe id of this node.
selfInfoThis node as the registry sees it (roles, zone, labels, address, version, schema hash, load).
shardsThe shard groups of the cluster.

См. также