fix(codec): Enforce encoders/decoders are Sync (#84)

Closes #81
This commit is contained in:
Lucio Franco
2019-10-30 15:00:31 -04:00
committed by GitHub
parent 5b4f4689a2
commit 3ce61d9860
11 changed files with 62 additions and 53 deletions
+2 -2
View File
@@ -124,7 +124,7 @@ fn generate_trait_methods(service: &Service, proto_path: &str) -> TokenStream {
quote! {
#stream_doc
type #stream: Stream<Item = Result<#res_message, tonic::Status>> + Send + 'static;
type #stream: Stream<Item = Result<#res_message, tonic::Status>> + Send + Sync + 'static;
#method_doc
async fn #name(&self, request: tonic::Request<#req_message>)
@@ -142,7 +142,7 @@ fn generate_trait_methods(service: &Service, proto_path: &str) -> TokenStream {
quote! {
#stream_doc
type #stream: Stream<Item = Result<#res_message, tonic::Status>> + Send + 'static;
type #stream: Stream<Item = Result<#res_message, tonic::Status>> + Send + Sync + 'static;
#method_doc
async fn #name(&self, request: tonic::Request<tonic::Streaming<#req_message>>)