hyperlane_plugin_gateway/enum.rs
1/// Upstream selection algorithm used by a [`crate::GatewayRoute`].
2#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3pub enum LoadBalanceStrategy {
4 /// Cycles evenly through healthy upstreams.
5 #[default]
6 RoundRobin,
7 /// Selects the healthy upstream with the fewest active in-flight requests.
8 LeastConnections,
9 /// Distributes requests proportionally to each [`crate::UpstreamTarget`]'s weight.
10 WeightedRoundRobin,
11 /// Picks two candidate upstreams and selects the one with fewer active connections (`O(1)`).
12 PowerOfTwoChoices,
13}