feat(client): rename client::Builder pool options (#2142)

- Renamed `keep_alive_timeout` to `pool_idle_timeout`.
- Renamed `max_idle_per_host` to `pool_max_idle_per_host`.
- Deprecated `keep_alive(bool)` due to confusing name. To disable the
  connection pool, call `pool_max_idle_per_host(0)`.
This commit is contained in:
Sean McArthur
2020-02-27 14:25:06 -08:00
committed by GitHub
parent 48102d6122
commit a82fd6c94a
4 changed files with 63 additions and 45 deletions

View File

@@ -1282,13 +1282,9 @@ mod dispatch_impl {
let _ = rx2.recv();
});
let client =
Client::builder()
.keep_alive(false)
.build(DebugConnector::with_http_and_closes(
HttpConnector::new(),
closes_tx,
));
let client = Client::builder().pool_max_idle_per_host(0).build(
DebugConnector::with_http_and_closes(HttpConnector::new(), closes_tx),
);
let req = Request::builder()
.uri(&*format!("http://{}/a", addr))