Add basic load balancing

This commit is contained in:
Lucio Franco
2019-09-02 16:39:16 -04:00
parent 142bb8f2b9
commit 782c0c19db
10 changed files with 253 additions and 7 deletions
+6 -2
View File
@@ -7,9 +7,13 @@ pub mod hello_world {
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let origin = http::Uri::from_static("http://[::1]:50051");
let origin = vec![
http::Uri::from_static("http://[::1]:50051"),
http::Uri::from_static("http://[::1]:50051"),
http::Uri::from_static("http://[::1]:50051"),
];
let svc = Channel::builder().build(origin)?;
let svc = Channel::builder().balance_list(origin)?;
let mut client = hello_world::GreeterClient::new(svc);