59 Commits

Author SHA1 Message Date
tottoto 5bcebaf3ca chore: Update to rustls 0.21 (#1340) 2023-04-03 13:30:18 +00:00
tottoto 893249e216 chore: Minimize cargo-deny skip tree (#1338) 2023-04-03 13:29:46 +00:00
Rafael Lemos d471212ee8 feat(types): Add gRPC Richer Error Model support (Examples) (#1300)
* types: remove unnecessary cloning from `ErrorDetails` getters

Breaking change.

* examples: add `richer-error` examples

Following implementation at flemosr/tonic-richer-error.
2023-03-14 15:26:35 +00:00
tottoto 838d91aca3 chore: Update to tower-http 0.4 (#1296)
* chore: Update to tower-http 0.4

* chore(tonic): Update to axum 0.6.9
2023-02-27 14:33:14 +00:00
tottoto 1547f968b4 chore(examples): Remove tracing-attributes from dependencies (#1289) 2023-02-23 10:06:37 +00:00
tottoto b712df608f chore(examples): Split tls-rustls example (#1272) 2023-02-15 14:47:09 +00:00
tottoto 82770713b5 chore(examples): Add missing dep to hyper (#1225) 2023-02-08 18:25:28 +00:00
tottoto b3567a394f chore: Add cargo-machete to detect unused dependencies (#1259) 2023-02-08 09:08:21 -05:00
tottoto 54c37a7c51 chore(examples): Turn off warp default features (#1227) 2023-01-10 16:02:48 -05:00
tottoto 2ec0f87767 chore(examples): Remove unnecessary asyncronous file io to read data for example (#1219) 2023-01-06 14:34:51 -05:00
tottoto a72cf04b44 chore: Remove unused tracing-futures from dependencies (#1208) 2022-12-20 16:13:46 -05:00
tottoto b45c5b5fa7 chore(examples): Clarify dependencies (#1205) 2022-12-20 11:29:45 -05:00
tottoto c3e5044fca chore(examples): Remove unused pin-project from dependencies (#1195) 2022-12-15 12:59:27 -05:00
tottoto bf22a740c3 chore: Update to 2021 edition (#1188) 2022-12-13 15:16:49 -05:00
tottoto 5c8a5d709c chore(examples): Fix blocking-server (#1173) 2022-11-30 13:38:39 -05:00
tottoto 076a81ce6e chore(examples): Update to listenfd 1.0 (#1168) 2022-11-29 14:00:20 -05:00
Lucio Franco ec359ba35f chore: Prepare 0.8 release (#1044) 2022-07-29 16:45:57 -04:00
Marcus Griep a585a72293 feat!: remove codegen dependency on compression feature (#1004) 2022-06-13 17:48:27 -04:00
Brandon Williams de2e4ac077 feat(build): Better support for custom codecs (#999)
BREAKING CHANGE: `CODEC_PATH` moved from const to fn
2022-05-05 12:52:03 -04:00
Lucio Franco 6857c834c2 chore: Fix rustls server example (#997) 2022-05-04 15:34:37 -04:00
David Pedersen 13b55df1d0 chore: update tower-http (#985)
* Update tower-http

* one more update
2022-04-27 15:14:55 +02:00
Lucio Franco 03fb09ccb8 chore: Add rustls examples (#968) 2022-04-07 14:24:04 -04:00
Jesse Szwedko c78274e3fe feat: Update prost to 0.10 (#948) 2022-03-30 10:43:06 -04:00
Sylwester Rąpała 01e5be5080 Add example of detecting client drops in bidirectional streams on server side (#931) 2022-03-03 11:50:43 -05:00
tottoto daf406dd2b chore: Update tracing-subscriber to 0.3 (#873) 2021-12-30 09:53:02 +01:00
David Pedersen 101f2f76d4 chore: revert to 2018 edition (#847)
Fixes https://github.com/hyperium/tonic/issues/843
2021-12-07 09:49:07 +01:00
Lucio Franco 1f3df8db9e chore: Upgrade to 2021 edition (#808) 2021-10-24 21:12:20 -04:00
Eliza Weisman 09805ece45 feat: Update prost and friends to 0.9 (#791) 2021-10-19 10:59:28 -04:00
Lucio Franco 4604042934 Add streaming example w/ client disconnect (#782) 2021-10-07 17:04:26 -04:00
David Pedersen 5aa8ae1fec feat(examples): add grpc-web example (#710)
Creates a server using tonic-web and a client that uses a regular
`hyper::Client` and issues a regular HTTP/1.1 request.
2021-07-09 18:02:43 +02:00
David Pedersen acdb3273bb chore: update prost, and related crates, to 0.8 (#703)
* chore: update prost, and related crates, to 0.8

Updates prost, prost-derive, prost-build, and prost-types to 0.8.

* Update the last few places
2021-07-08 15:02:02 -04:00
Lucio Franco 2346d99f6e example: Add mocked io example (#677)
* example: Add mocked io example

* fix mock example

* Remove uniex bound for mock impl
2021-07-08 10:45:04 -04:00
David Pedersen 0583cff80f feat(codec): compression support (#692)
* 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
2021-07-02 11:25:03 -04:00
David Pedersen 4dda4cbcca feat(tonic): Use BoxBody from http-body crate (#622)
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
2021-05-18 10:41:21 +02:00
James Nugent c54f24721c feat: Implement gRPC Reflection Service (#340)
Co-authored-by: Samani G. Gikandi <samani@gojulas.com>
2021-02-16 11:07:51 -05:00
Jordan Gould 4fe5beb353 Update Warp dependency in examples/Cargo.toml (#541) 2021-01-19 19:34:45 -05:00
Lucio Franco fda2d689d4 chore: Prepare 0.4 release (#538)
* Prepare `0.4` release

* Fix cargo issues
2021-01-15 13:38:36 -05:00
Quentin Perez fdda5ae26a Upgrade to Tokio 1.0.0 ecosystem (#530)
* 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>
2021-01-11 12:18:34 -05:00
Koki Kato e7be352132 transport: impl Service for Channel instead of GrpcService (#482)
* 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
2021-01-05 13:36:18 -05:00
Lucio Franco 9ea4a64a6c examples: Add tower-client example (#466) 2020-09-29 11:16:07 -04:00
T.J. Telan 37f6733f85 feat(transport): Add Router::into_service (#419)
Co-authored-by: Danny Hua <danny@42layers.io>
2020-08-20 15:11:31 -04:00
Harry Barber 2b997b0c5f feat(transport): Add optional service methods (#275) 2020-07-10 12:39:52 -04:00
Eliza Weisman 034c850254 examples: update to tracing 0.1.16, use #[instrument] (#354)
* 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>
2020-07-10 11:59:18 -04:00
Kaleb Elwert 80e90e3b5d Add tower server example (#375)
Note that this also adds `impl From<Status> for http::Response<BoxBody>`
in order to make writing middleware which can return an error much
easier.
2020-06-22 12:04:02 -04:00
Taiki Endo 5bda615632 fix: Remove uses of pin_project::project attribute (#367)
pin-project will deprecate the project attribute due to some unfixable
limitations.

Refs: https://github.com/taiki-e/pin-project/issues/225
2020-06-09 13:09:35 -04:00
Dawid Nowak 85ae0a4733 feat(transport): Dynamic load balancing (#341) 2020-05-15 15:03:28 -04:00
thisKai f6ecaff0de chore(example): Autoreloading server example (#316)
* 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
2020-04-09 17:55:53 -04:00
Lucio Franco 3cba9f5f6f chore: Fix feature flags and build docs (#311)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2020-03-30 12:02:10 -04:00
James Nugent da92dbf8aa feat(health): Add tonic-health server impl
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.md

Fixes #135.
2020-03-30 09:33:02 -05:00
Gyusun Yeom f65cda1ea0 feat(build): Decouple codgen from prost (#170) 2020-03-01 13:52:31 -05:00