load-balancer-0.3.7 has been yanked.
load-balancer
A set of asynchronous load balancers for Rust, supporting multiple strategies:
- IP — bind clients to specific system IPs.
- Threshold — limit retries based on failure count.
- Limit — restrict per-node usage per interval.
- Random — randomly choose entries.
- Simple — round-robin sequential allocator.
- Interval — allocate resources on timed intervals.
- Proxy — maintain a proxy connection pool.
Examples
async
Output
0s Allocated node: node 1
0s Allocated node: node 1
0s Allocated node: node 2
0s Allocated node: node 2
1s Allocated node: node 1
1s Allocated node: node 1
1s Allocated node: node 2
1s Allocated node: node 2
------------------------------
0s Allocated node: node 1
0s Allocated node: node 1
0s Allocated node: node 1
0s Allocated node: node 2
5s Allocated node: node 1
5s Allocated node: node 1
5s Allocated node: node 1
5s Allocated node: node 2