-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tonic example #72
Tonic example #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left a few comments inline.
>; | ||
|
||
// Build a client with a few middlewares applied and connect to the server | ||
async fn make_client(addr: SocketAddr) -> Result<Client, tonic::transport::Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet you could use impl Trait for the return type here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this
async fn make_client(
addr: SocketAddr,
) -> Result<
KeyValueStoreClient<
impl Service<
hyper::Request<BoxBody>,
Response = hyper::Response<impl HttpBody<Error = impl Into<BoxError>>>,
Error = impl Into<BoxError>,
> + Clone
+ Send
+ Sync
+ 'static,
>,
tonic::transport::Error,
> {
The Clone + Send + Sync + 'static
bound isn't strictly necessary for this example but I figure it might be nice to include for users copying this code.
Fixes #63