Hey everyone,

Looking through the gRPC ruby guide, I noticed that the channel isn't 
created separately from the Stub like in other examples (such as Java). 
After digging into gRPC, I found that the ClientStub takes a 
channel_override parameter 
<https://github.com/grpc/grpc/blob/aafa875cb389140cf721d8470a3a05cf930f74b2/src/ruby/lib/grpc/generic/client_stub.rb#L64-L66>,
 
which may allow us to share channels across many stubs.

1. How do I properly instantiate a GRPC::Core::Channel object? The 
documentation for this pattern doesn't exist. I've currently got something 
like:

ssl_creds = GRPC::Core::ChannelCredentials.new("ca_file_path")
grpc_channel = GRPC::Core::Channel.new("url", {}, ssl_creds)
client = MyService::Stub.new("url", nil, :channel_override => grpc_channel)


Also, 
2. Is sharing channels in gRPC ruby recommended? An older discussion here 
<https://groups.google.com/forum/#!searchin/grpc-io/sharing$20channels%7Csort:relevance/grpc-io/jc-cZak29V4/At25yF4-AAAJ>
 recommends 
it, but I found a commit here on gitlab 
<https://gitlab.com/gitlab-org/gitlab-ce/commit/4ea02bf88a2e2271878ffef5998d9414e82a8f44>,
 
which suggests that many stubs sharing a single channel may not be stable.


Thanks,
Jason

-- 
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/f46f635c-dc83-4d7e-bda0-5cf270e06c8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to