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")
}
}Output
nobody serves Bank
pub(api) fn pick(name: str, by: PickBy = .LeastLoad, prefer: Prefer = .Any) -> ClusterMember?Since. 1.0.0-beta
Parameters
Returns
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/node.oxl:539