File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -69,12 +69,19 @@ use tower_http::follow_redirect::FollowRedirect;
6969/// are set to what is usually the most commonly desired value. To configure a
7070/// `Client`, use `Client::builder()`.
7171///
72- /// The `Client` holds a connection pool internally, so it is advised that
72+ /// The `Client` holds a connection pool internally to improve performance
73+ /// by reusing connections and avoiding setup overhead, so it is advised that
7374/// you create one and **reuse** it.
7475///
7576/// You do **not** have to wrap the `Client` in an [`Rc`] or [`Arc`] to **reuse** it,
7677/// because it already uses an [`Arc`] internally.
7778///
79+ /// # Connection Pooling
80+ ///
81+ /// The connection pool can be configured using [`ClientBuilder`] methods
82+ /// with the `pool_` prefix, such as [`ClientBuilder::pool_idle_timeout`]
83+ /// and [`ClientBuilder::pool_max_idle_per_host`].
84+ ///
7885/// [`Rc`]: std::rc::Rc
7986#[ derive( Clone ) ]
8087pub struct Client {
@@ -1406,6 +1413,8 @@ impl ClientBuilder {
14061413 }
14071414
14081415 /// Sets the maximum idle connection per host allowed in the pool.
1416+ ///
1417+ /// Default is `usize::MAX` (no limit).
14091418 pub fn pool_max_idle_per_host ( mut self , max : usize ) -> ClientBuilder {
14101419 self . config . pool_max_idle_per_host = max;
14111420 self
You can’t perform that action at this time.
0 commit comments