Commit Graph

70 Commits

Author SHA1 Message Date
Lucio Franco 1934825ff5 chore: Fix ci tests 2023-04-24 14:52:25 -04:00
Lucio Franco c09fc23088 chore: Fix cargo deny warnings (#1374) 2023-04-24 17:41:43 +00:00
Auri 4942dd4a43 tonic-build: option to emit Arc<Self> as server receiver (#1352)
This implements an option to emit `Arc<Self>` instead of `&self` in
server traits. This enables implementor to reference `Self` data for
indefinite duration, which may be useful for streaming requests.

Fixes: #1351
2023-04-19 19:36:43 +00:00
Lucio Franco f276934d22 chore: Add streaming response limit test (#1363) 2023-04-17 15:19:51 +00:00
YiiSh b54ce2321a feat(transport): Addlocal_addr to Request o (#1327) 2023-03-31 17:09:50 +00:00
Lucio Franco ff331199e4 feat(core): Default encoding/decoding limits (#1335)
* feat(core): Default encoding/decoding limits

This PR adds new defaults for both client and server max
encoding/decoding message size limits. By default, the max message
decoding size is `4MB` and the max message encoding size is
`usize::MAX`.

This is follow up work from https://github.com/hyperium/tonic/pull/1274

BREAKING: Default max message encoding/decoding limits

* update generated code
2023-03-30 16:59:08 +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
林玮 (Jade Lin) 7a6b20d8ef feat: add GrpcMethod extension into request for client (#1275)
* feat: add GrpcMethod extension into request for client

* refactor: change GrpcMethod fields into private and expose methods instead

* refactor: hide GrpcMethod::new in doc

---------

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2023-02-23 10:06:45 +00:00
tottoto b3567a394f chore: Add cargo-machete to detect unused dependencies (#1259) 2023-02-08 09:08:21 -05:00
tottoto 0ac0ce8ce7 chore: Remove unused dependencies (#1244) 2023-02-04 05:12:17 -05:00
Richard ff642f9233 feat(build): Builder: add {enum,message}_attributes (#1234)
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
2023-01-17 14:25:21 -05:00
Shrutesh Pachineela a562a3ce32 fix(build): Allow Services to be named Result (#1203)
closes #1156
2022-12-21 12:07:07 -05:00
tottoto bf22a740c3 chore: Update to 2021 edition (#1188) 2022-12-13 15:16:49 -05:00
tottoto 363c04a2e8 chore: Remove unused bytes from dependencies (#1186) 2022-12-13 13:06:13 -05:00
tottoto 2dd09c02bd chore: Fix clippy lint (#1181) 2022-12-13 11:29:29 -05:00
bouzuya e188521149 feat(build): Add disable_comments option (#1127) 2022-11-08 11:08:19 -05:00
Lucio Franco ec359ba35f chore: Prepare 0.8 release (#1044) 2022-07-29 16:45:57 -04:00
Quentin Perez 4388d822c4 tonic: Introduce a new method on Endpoint to override the origin (#1013) 2022-06-20 09:29:11 -04:00
Marcus Griep a585a72293 feat!: remove codegen dependency on compression feature (#1004) 2022-06-13 17:48:27 -04:00
David Pedersen 13b55df1d0 chore: update tower-http (#985)
* Update tower-http

* one more update
2022-04-27 15:14:55 +02:00
Conrad Ludgate 4533a6e20e fix(build): Reduce Default bound requirement (#974)
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-04-20 15:38:38 -04:00
Jesse Szwedko c78274e3fe feat: Update prost to 0.10 (#948) 2022-03-30 10:43:06 -04:00
Lucio Franco d4973642da chore: Remove MockStream (#923) 2022-02-22 16:21:39 -05:00
Lucio Franco a197c20469 fix(transport): connect w/ connector infailable (#922) 2022-02-22 15:33:29 -05:00
Sylwester Rąpała c9e78c4d65 chore: Fulfill MIT license requirments (#916) 2022-02-18 13:56:47 -05:00
Anthony Green dee2ab52ff feat(transport): add unix socket support in server (#861) 2022-02-14 15:00:58 -05:00
tottoto f58fda42a9 chore(tests): Update tower-http to 0.2 (#878) 2022-01-12 16:34:59 -05:00
tottoto 366d888a4b chore: Fix clippy lints (#881) 2022-01-12 16:32:40 -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 23c1392fb7 fix(tonic): Remove Sync requirement for streams (#804) 2021-10-24 21:48:05 -04:00
Lucio Franco 1f3df8db9e chore: Upgrade to 2021 edition (#808) 2021-10-24 21:12:20 -04:00
Tom Dyas ff6a690cec fix(build): Correctly convert Empty to () (#734) 2021-10-22 08:44:27 -04:00
David Freese 4947b076f5 fix(transport): Correctly map hyper errors (#629)
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-10-20 11:05:27 -04:00
Nisheeth Barthwal 2e471548d8 fix(tonic): change connect_lazy to be infallible (#712)
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-10-20 10:47:17 -04:00
Julien Roncaglia 88008191fc compression: handle compression flag but no header (#763)
Co-authored-by: Quentin Perez <qperez42@gmail.com>
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-10-20 10:02:52 -04:00
Lucio Franco 4054d61e14 fix(tonic): Status code to set correct source on unkown error (#799) 2021-10-19 11:52:59 -04:00
Eliza Weisman 09805ece45 feat: Update prost and friends to 0.9 (#791) 2021-10-19 10:59:28 -04:00
David Pedersen 380d81dd86 fix(build): allow services to be named Service (#709)
Fixes https://github.com/hyperium/tonic/issues/676
2021-07-12 16:47:45 +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
Lucio Franco 737ace393d fix(codec): Fix streaming reponses w/ many status (#689)
Closes #681
2021-07-01 10:25:43 -04:00
David Pedersen e82f0b0399 build: generate root crate paths correctly (#623)
We shouldn't append `proto_path` (`super` by default) if the path starts
with `crate::`.

Fixes https://github.com/hyperium/tonic/issues/548
2021-06-02 16:58:43 +02:00
David Pedersen e5e311853b feat(transport): provide generic access to connect info (#647) 2021-05-28 13:27:37 +02:00
David Pedersen 4d2667d1cb feat(tonic): make it easier to add tower middleware to servers (#651) 2021-05-19 09:19:58 +02:00
David Pedersen 352b0f584b feat(tonic): add Request and Response extensions (#642)
Adds `tonic::Extensions` which is a newtype around `http::Extensions`.

Request extensions can be set by interceptors with
`Request::extensions_mut` and retrieved from RPCs with
`Request::extensions`. Extensions can also be set in tower middleware
and will be carried through to the RPC.

Since response extensions cannot be set by interceptors the main use
case is to set them in RPCs and retrieve them in tower middlewares.
Figured that might be useful.

Fixes https://github.com/hyperium/tonic/issues/255
2021-05-13 15:54:20 +02:00
David Pedersen 9ff4f7b8e4 feat(transport): Support timeouts with "grpc-timeout" header (#606)
* transport: Support timeouts with "grpc-timeout" header

* Apply suggestions from code review

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>

* Timeout -> GrpcTimeout and export TimeoutExpired

* Clean up imports

* Give header name a more proper home

* Add fuzz tests for parsing header value into `grpc-timeout`

* Map `TimeoutExpired` to `cancelled` status

* Recover from timeout errors in the service

* Refactor tests

* Fix CI

* Fix CI, again

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-04-29 10:28:16 +02:00
Ben Sully 6c898a239f Use fully qualified path for futures_core::Stream in codegen (#591) 2021-03-28 19:31:20 +02:00
Tom Dyas 61555ff2b5 feat(build): Support compiling well-known protobuf types (#522) 2021-02-23 16:21:03 -05:00