diff --git a/tower-buffer/src/service.rs b/tower-buffer/src/service.rs index 2a05dc9..3d55738 100644 --- a/tower-buffer/src/service.rs +++ b/tower-buffer/src/service.rs @@ -34,6 +34,12 @@ where /// /// The default Tokio executor is used to run the given service, which means that this method /// must be called while on the Tokio runtime. + /// + /// # Note on setting `bound` + /// When `Buffer`'s implementation of `poll_ready` returns `Poll::Ready`, it reserves a + /// slot in the channel for the forthcoming `call()`. However, if this call doesn't arrive, + /// this reserved slot may be held up for a long time. As a result, it's advisable to set + /// `bound` to be at least the maximum number of concurrent requests the `Buffer` will see. pub fn new(service: T, bound: usize) -> Self where T: Send + 'static,