Add Buffer::new note on how to set bound (#425)
This commit is contained in:
parent
52d9e95a38
commit
b6f5f586c5
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue