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, 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 recommends it, but I found a commit
here on gitlab, which suggests that many stubs sharing a single channel may not be stable.
Thanks,
Jason