Each stream does not require a separate thread; gRPC multiplexes these onto 
your threads.  It is slightly different for each language, but in general 
threading isn't that much of a problem.


As for your second question, can you mention what language you are using? 
 That will affect the answer.

On Tuesday, January 3, 2017 at 10:27:41 AM UTC-8, [email protected] wrote:
>
> Hello,
>
> I am very interested in the gRPC bi-directional streaming feature. I have 
> a few questions on the server side. In the .proto file, I define a simple 
> streaming RPC and message below
>
> service MfMessaging {
>   rpc MfRpc (stream MfStream) returns (stream MfStream) {}
> }
> message MfStream {
>   bytes message=1;
> }
>
> My first question is: what is the thread model at server side? I mean how 
> gRPC handles if there are multiple concurrent requests from different 
> clients? Does gRPC spawn a thread for each client? If yes, is there any 
> limit or gRPC has a thread pool underneath?
>
> My second question is: In the service routine, I get a ServerReaderWriter 
> stream (e.g. ServerReaderWriter<MfStream, MfStream>* stream). What is 
> lifetime of this stream? Can I pass this stream to another thread which 
> writes response back later?
>
> Look forward to your reply. Thank you very much!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/d5ee79f1-9e7e-459c-89d6-6294d52a6dff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to