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")}")
}Вывод
true
pub(api) fn isLeader(name: str) -> boolСложность. O(1).
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
name | str |
Возвращает
bool
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/node.oxl:464