fix(client): Use Stream instead of TrySteam for client calls (#61)

This commit is contained in:
Juan Alvarez
2019-10-10 11:39:35 -04:00
committed by Lucio Franco
parent 8cddf8a12c
commit 7eda823c9c
5 changed files with 16 additions and 21 deletions
+2 -2
View File
@@ -133,7 +133,7 @@ fn generate_client_streaming(method: &Method, proto: &str, path: String) -> Toke
quote! {
pub async fn #ident<S>(&mut self, request: tonic::Request<S>)
-> Result<tonic::Response<#response>, tonic::Status>
where S: Stream<Item = Result<#request, tonic::Status>> + Send + 'static,
where S: Stream<Item = #request> + Send + 'static,
{
self.ready().await?;
let codec = tonic::codec::ProstCodec::new();
@@ -151,7 +151,7 @@ fn generate_streaming(method: &Method, proto: &str, path: String) -> TokenStream
quote! {
pub async fn #ident<S>(&mut self, request: tonic::Request<S>)
-> Result<tonic::Response<tonic::codec::Streaming<#response>>, tonic::Status>
where S: Stream<Item = Result<#request, tonic::Status>> + Send + 'static,
where S: Stream<Item = #request> + Send + 'static,
{
self.ready().await?;
let codec = tonic::codec::ProstCodec::new();