On Tue, Aug 30, 2016 at 2:36 PM, <[email protected]> wrote:

> I'm confused on how threads work in Grpc. If I create a stub, either
> blocking or non blocking, can I share it across threads?
>
Yes

> Will a call to one of the stub's methods be handled in a thread-safe way?
>
Yes

>
> Is it common to create a new stub for each call?
>

Yes but only if you need to change the behavior of the stub. E.g to change
deadlines for calls.


> Or can I use one that persists for a long time?
>

Yes

>
> What about channels on the client side? Thread safe?
>

Yes

>
> Can I share a channel across stubs? Or should each stub get its own
> channel?
>

Share a channel with lots of stubs for connection re-use.


>
> --
> 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/d27c5f45-65f5-4da6-9c04-56118279ceab%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/d27c5f45-65f5-4da6-9c04-56118279ceab%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CADQ0XY1LezcK6ZdfwgG8AGM6k8VzX3SZzLxQ7tBdR3YS0OZaDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to