Commit Graph

17 Commits

Author SHA1 Message Date
Lucio Franco 2ea17b2ecf fix(transport): Return connection error on Channel::connect (#413)
Before this fix, if the connect phase of the transport failed before
ever establishing a connection, we would never return the error until
the first call to send a request. This PR changes that behavior to only
forward the error to the call method if we have ever made a connection
before. If we have never established a connection before then
`Reconnect` will return an error on the call to `poll_ready`.

Fixes #403
2020-07-27 12:44:11 -04:00
Dmitry Shuranov 372da52e96 feat: Add metadata to error responses (#348) 2020-05-10 11:46:45 -04:00
Lucio Franco e683ffef1f fix: base64 encode details header (#345) 2020-05-07 15:31:26 -04:00
Yonathan Randolph 5d56daa721 fix(build): Remove ambiguity in service method call (#327)
When calling methods on Arc<MyService> where the method is also defined on Arc (e.g. drop and clone), calling inner.#method_ident(request) will actually attempt to call the Arc method instead of the method on the service, resulting in a compile error. This change removes the ambiguity by dereferencing the inner Arc.
2020-04-09 13:40:26 -04:00
Lucio Franco e5b1f8a172 chore: Rename internal uuid crate (#319)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2020-04-01 12:35:11 -04:00
Lucio Franco 2e082f8b3e chore(build): Refactor codegen traits (#302)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2020-03-29 12:57:11 -04:00
Gyusun Yeom f65cda1ea0 feat(build): Decouple codgen from prost (#170) 2020-03-01 13:52:31 -05:00
Danny Hua 1b3d107206 fix(build): Don't replace extern_paths (#261)
* don't replace extern_path'd paths

tonic-build will replace all paths except for google well known types
with one rooted at the super module. For paths that have already been
replaced with a fully qualified path via the extern_path config option,
(e.g. "::uuid::Uuid"), this results in an invalid path
(e.g. "super::::uuid::Uuid"), and a build failure. These paths should
also be excluded when prefixing relative modules with super.

* add doc in tonic-build clarifying extern_path

extern_path expects fully qualified proto and rust paths

* add test cast case for extern path fix

add a test that extern path does indeed result in service types using
the specified type from an external crate. we test this by creating a
service type that has a proto from a different crate, and asserting that
it does indeed impl a trait from that crate

* add license/publish to extern_path test crates
2020-02-18 09:56:32 -05:00
Marcel dadc8186c2 chore: Upgrade to prost, prost-build and prost-derive 0.6 (#230) (#231) 2020-01-13 09:40:57 -05:00
Lucio Franco 6673f91f1f chore: Remove required bytes dep and clean up deny (#227)
* chore: Remove required bytes dep and clean up deny

* Fix interop test cli args
2020-01-11 12:48:24 -08:00
Adam Jacob 8997f47b6d chore: Upgrade to prost master and bytes 0.5 (#224)
This upgrades tonic to prost's master branch, and moves everything to
bytes 0.5.
2020-01-11 11:05:08 -08:00
Juan Alvarez 3a5c66d5f2 fix(build): snake_case service names (#190) 2019-12-14 15:08:28 -05:00
Lucio Franco 0847b67c4e fix(build): Allow creating multiple services in the same package (#173)
BREAKING CHANGE: Build will now generate each service client and server into their own modules.
2019-12-11 16:22:03 -05:00
Lucio Franco 3387ef900f Upgrade to tokio 0.2 (#163) 2019-12-06 00:09:46 -05:00
Jake Shadle fbd91c3773 chore(build): Add cargo-deny CI workflow and configuration 2019-11-14 18:59:04 +02:00
James Steele b02b4b238b fix(build): Prevent duplicated client/server generated code (#121)
* fix(build): Prevent duplicated client/server generated code

The tonic-build process collects up RPC services as they are provided by
prost, before writing them out as part of the finalization step for a
given protocol buffer package.

In the case of imported protocol buffer packages, there may be RPC
services included by import in addition to those in the top-level
package. Therefore it is necessary to make sure each set of
client/server services gathered by tonic-build is cleared after the
finalization process for a given protocol buffer package, otherwise they
will be incorrectly aggregated as the generation process proceeds
through the subsequent packages.

* Test case for duplicated client/server generated code

A simple test case that will fail to build without a fix to prevent
RPC services being duplicated into inappropriate modules (that related
to particular protocol buffer packages).

* Additional test case for included_service

Introduces an additional case that captures making sure services defined
before including a package with additional services doesn't
incidentially clear such precursor services from the including package.

* Fix unnecessary newline to keep `cargo fmt` happy
2019-11-09 15:45:22 +00:00
Lucio Franco 1dbde95d84 fix(build): Fix service and rpc name conflict (#92)
Closes #89
2019-10-23 15:01:04 -04:00