method ClusterApi.isLeader
Whether this node currently holds the leadership of the task name (always true outside a cluster).
Example:
fn main() io {
print("{cluster.isLeader("cleanup")}")
}Output
true
pub(api) fn isLeader(name: str) -> boolComplexity. O(1).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
name | str |
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/node.oxl:464