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

method ClusterApi.isLeader

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

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{cluster.isLeader("cleanup")}")
}
Вывод
true
pub(api) fn isLeader(name: str) -> bool

Сложность. O(1).

С версии. 1.0.0-beta

Параметры

ИмяТип
namestr

Возвращает

bool

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/node.oxl:464

См. также