perf(http2): less eager server polls since it hurts parallel flushing

This commit is contained in:
Sean McArthur
2018-10-24 15:35:11 -07:00
parent 6005827c3e
commit b20971cb4e
2 changed files with 50 additions and 10 deletions

View File

@@ -134,16 +134,8 @@ where
let req = req.map(|stream| {
::Body::h2(stream, content_length)
});
let mut fut = H2Stream::new(service.call(req), respond);
// try to eagerly poll the future, so that we might
// not need to allocate a new task...
match fut.poll() {
Ok(Async::Ready(())) | Err(()) => (),
Ok(Async::NotReady) => {
exec.execute_h2stream(fut)?;
}
}
let fut = H2Stream::new(service.call(req), respond);
exec.execute_h2stream(fut)?;
}
// no more incoming streams...