Remove buffer from BoxRoute (#270)

Boxing a service normally means using `tower::util::BoxService`. That
doesn't implement `Clone` however so normally I had been combining it
with `Buffer` to get that.

But recently I discovered https://github.com/dtolnay/dyn-clone which
makes it possible to clone trait objects. So this adds a new internal
utility called `CloneBoxService` which replaces the previous
`BoxService` + `Buffer` combo in `BoxRoute`.

I'll investigate upstreaming that to tower. I think it makes sense there
since box + clone is quite a common need.
This commit is contained in:
David Pedersen
2021-08-26 06:34:53 +00:00
committed by GitHub
parent 20f6c3b509
commit 552d69e5d4
7 changed files with 96 additions and 219 deletions
-1
View File
@@ -1004,7 +1004,6 @@
#[macro_use]
pub(crate) mod macros;
mod buffer;
mod error;
mod json;
mod util;