Use use max_items as bound in tower-batch (#1691)
This commit is contained in:
parent
e455c3fa8a
commit
bfb3de7a8a
|
@ -57,8 +57,12 @@ where
|
||||||
T::Error: Send + Sync,
|
T::Error: Send + Sync,
|
||||||
Request: Send + 'static,
|
Request: Send + 'static,
|
||||||
{
|
{
|
||||||
// XXX(hdevalence): is this bound good
|
// The semaphore bound limits the maximum number of concurrent requests
|
||||||
let bound = 1;
|
// (specifically, requests which got a `Ready` from `poll_ready`, but haven't
|
||||||
|
// used their semaphore reservation in a `call` yet).
|
||||||
|
// We choose a bound that allows callers to check readiness for every item in
|
||||||
|
// a batch, then actually submit those items.
|
||||||
|
let bound = max_items;
|
||||||
let (tx, rx) = mpsc::unbounded_channel();
|
let (tx, rx) = mpsc::unbounded_channel();
|
||||||
let (handle, worker) = Worker::new(service, rx, max_items, max_latency);
|
let (handle, worker) = Worker::new(service, rx, max_items, max_latency);
|
||||||
tokio::spawn(worker.run());
|
tokio::spawn(worker.run());
|
||||||
|
|
Loading…
Reference in New Issue