diff --git a/.bleep b/.bleep index 87e4334..1198c86 100644 --- a/.bleep +++ b/.bleep @@ -1 +1 @@ -c02dc12f1f7caf9aa90a13112321cf5c3d2f6b6d \ No newline at end of file +f6e596e897d73c69369ae85edf58cec64b106969 \ No newline at end of file diff --git a/pingora-load-balancing/src/lib.rs b/pingora-load-balancing/src/lib.rs index c5adea3..4009dc1 100644 --- a/pingora-load-balancing/src/lib.rs +++ b/pingora-load-balancing/src/lib.rs @@ -77,12 +77,18 @@ impl Backend { /// Create a new [Backend] with `weight` 1. The function will try to parse /// `addr` into a [std::net::SocketAddr]. pub fn new(addr: &str) -> Result { + Self::new_with_weight(addr, 1) + } + + /// Creates a new [Backend] with the specified `weight`. The function will try to parse + /// `addr` into a [std::net::SocketAddr]. + pub fn new_with_weight(addr: &str, weight: usize) -> Result { let addr = addr .parse() .or_err(ErrorType::InternalError, "invalid socket addr")?; Ok(Backend { addr: SocketAddr::Inet(addr), - weight: 1, + weight, ext: Extensions::new(), }) // TODO: UDS