From 68d2ab3339f1cc8bf4cf90c6c9fb37dbae251425 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Tue, 5 May 2020 10:27:53 -0700 Subject: [PATCH] Add some info about concurrent usage to client mod (#328) --- tonic/src/client/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tonic/src/client/mod.rs b/tonic/src/client/mod.rs index 3534058..56b25f4 100644 --- a/tonic/src/client/mod.rs +++ b/tonic/src/client/mod.rs @@ -6,6 +6,15 @@ //! //! This client is generally used by some code generation tool to provide stubs //! for the gRPC service. Thusly, they are a bit cumbersome to use by hand. +//! +//! ## Concurrent usage +//! +//! Upon using the your generated client, you will discover all the functions +//! corresponding to your rpc methods take `&mut self`, making concurrent +//! usage of the client difficult. The answer is simply to clone the client, +//! which is cheap as all client instances will share the same channel for +//! communication. For more details, see +//! [transport::Channel](../transport/struct.Channel.html#multiplexing-requests). mod grpc; mod service;