method ClusterApi.pick
One node that serves name: the least loaded one (by: .LeastLoad), or the first (.First); prefer: .SameZone limits the
choice to this node's zone when there is a node in it (§12.3).
Example:
fn main() io {
match cluster.pick("Bank", by: .LeastLoad, prefer: .SameZone) {
ClusterMember m => print("use {m.id.name}")
none => print("nobody serves Bank")
}
}Вывод
nobody serves Bank
pub(api) fn pick(name: str, by: PickBy = .LeastLoad, prefer: Prefer = .Any) -> ClusterMember?С версии. 1.0.0-beta
Параметры
Возвращает
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/node.oxl:539