OxL Reference

method ClusterApi.isLeader

Whether this node currently holds the leadership of the task name (always true outside a cluster).

Example:

oxl✓ checked in CI
fn main() io {
  print("{cluster.isLeader("cleanup")}")
}
Output
true
pub(api) fn isLeader(name: str) -> bool

Complexity. O(1).

Since. 1.0.0-beta

Parameters

NameType
namestr

Returns

bool

Effects

none declared (pure unless the body says otherwise)

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

See also