Select a node from the candidate set.
Eligible nodes to choose from.
Optionalregion: stringOptional preferred region; strategies typically restrict selection to nodes in this region when any exist, otherwise fall back to the full set.
Optional_key: stringOptional routing key (for example the room id) used by deterministic strategies to map the same key to the same node.
The selected node, or undefined when candidates is empty.
PlacementStrategy that picks the candidate node with the lowest current load.
Remarks
When a
regionis given it prefers nodes in that region, falling back to the full candidate set if none match, then returns the least-loaded node from the chosen pool. Ignores the routingkey— placement is purely load-driven, which spreads rooms evenly but does not keep a given room pinned to one node across calls. For stable pinning use HashRingStrategy.