* Initial compression support
* Support configuring compression on `Server`
* Minor clean up
* Test that compression is actually happening
* Clean up some todos
* channels compressing requests
* Move compression to be on the codecs
* Test sending compressed request to server that doesn't support it
* Clean up a bit
* Compress server streams
* Compress client streams
* Bidirectional streaming compression
* Handle receiving unsupported encoding
* Clean up
* Add note to future self
* Support disabling compression for individual responses
* Add docs
* Add compression examples
* Disable compression behind feature flag
* Add some docs
* Make flate2 optional dependency
* Fix docs wording
* Format
* Reply with which encodings are supported
* Convert tests to use mocked io
* Fix lints
* Use separate counters
* Don't make a long stream
* Address review feedback
As of `http-body` 0.4.1 its has had a `BoxBody` type similar to
`tonic::body::BoxBody`. It also has `Empty` and `Body::map_{data,err}`.
That means all the custom body things we had in tonic can basically be
replaced with that.
Note that this is a breaking change so we should merge this next time we
decide to ship a breaking release.
The breaking changes are:
- `tonic::body::Body` has been removed. I think its fine for users to
depend directly on `http-body` if they need this trait.
- `tonic::body::BoxBody` is now just a type alias for
`http_body::combinators::BoxBody<Bytes, Status>`. So the methods it
previously had are gone. The replacements are
- `tonic::body::Body::new` -> `http_body::Body::boxed`
- `tonic::body::Body::map_from` -> `http_body::Body::map_data` and
`http_body::Body::map_err` depending on which part you want to map.
- `tonic::body::Body::empty` -> `http_body::Empty`
Additionally a `Sync` bound has been added to a few methods. I actually
don't think this is a breaking change because the old
`tonic::body::Body` trait had `Sync` as a supertrait meaning the `Sync`
requirement was already there.
Fixes https://github.com/hyperium/tonic/issues/557
* Upgrade Tonic to Tokio 1.0
Work in progress for updating Tonic to Tokio 1.0. Since tower has not
been released to crates.io, a git dependency is taken instead.
* Upgrade Tonic to Tokio 1.0 phase 2
* tonic: remove tower-* deps
* Apply suggestions from code review
Co-authored-by: Ed Marshall <marshaled@protonmail.com>
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
* transport: impl Service for Channel instead of GrpcService
This adds tower::Service impl for tonic::transport::Channel
and removes GrpcService impl declaration.
Channel still implements GrpcService, thanks to the general
impl declaration of GrpcService for types who implement Service.
Fixes#481.
* examples: stop using GrpcService to avoid ambiguity
* examples: add timeout example
* examples: update to `tracing` 0.1.14, use `#[instrument]`
Now that `tracing-attributes`'s `#[instrument]` macro plays nicely with
`async-trait`, we can update the tracing example to use `instrument`.
This lets us simplify the events emitted in the example.
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
* feat(transport): Dynamic load balancing (#341)
* Fix typo (#356)
Co-authored-by: Dawid Nowak <nowakd@gmail.com>
Co-authored-by: Paulo Duarte <paulo@duarteweb.com>
* Create an example of an autoreloading server
* Document the autoreloading server example
* Format autoreloading server example
* Add note about cargo-watch in the examples readme
This commit adds a new crate `tonic-health` which implements the
[standard GRPC Health Checking][checking] protocol.
Currently there is only a server implementation, though others have
alluded in the discussion in #135 that client implementations exist
which could also be imported as necessary.
A example server has also been added - once the client work is done a
client for this should be added also.
[checking]: https://github.com/grpc/grpc/blob/master/doc/health-checking.mdFixes#135.