# `RpcLoadBalancer.LoadBalancer.SelectionAlgorithm.WeightedRoundRobin`
[🔗](https://github.com/MikaAK/rpc_load_balancer/blob/main/lib/rpc_load_balancer/load_balancer/selection_algorithm/weighted_round_robin.ex#L1)

Weighted round robin node selection algorithm.

Accepts a weight map via `algorithm_opts` where keys are node names and
values are positive integers representing relative capacity. Nodes with
higher weights receive proportionally more traffic.

## Usage

    RpcLoadBalancer.LoadBalancer.start_link(
      name: :my_balancer,
      selection_algorithm: RpcLoadBalancer.LoadBalancer.SelectionAlgorithm.WeightedRoundRobin,
      algorithm_opts: [weights: %{:"node1@host" => 3, :"node2@host" => 1}]
    )

Nodes not present in the weight map receive a default weight of 1.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
