diff options
author | 2016-04-14 13:38:35 -0700 | |
---|---|---|
committer | 2016-04-14 13:38:35 -0700 | |
commit | bcd49994e239e4d15bf4bc2fbed62eb2b914cc28 (patch) | |
tree | 596358ff50925df8e11649bc5888561ce0b54314 /src | |
parent | c7d06383f12651e23e6a63f3afdfc3a03f41a82c (diff) | |
parent | c6e24602c6c6f98c07eee874e0b39988d0766848 (diff) |
Merge pull request #6153 from vjpai/make_ruby_cqs_great_again
Provide CQ per client call in Ruby to avoid pluck limits
Diffstat (limited to 'src')
-rw-r--r-- | src/ruby/lib/grpc/generic/client_stub.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ruby/lib/grpc/generic/client_stub.rb b/src/ruby/lib/grpc/generic/client_stub.rb index 98e83a8396..a6bb92d72c 100644 --- a/src/ruby/lib/grpc/generic/client_stub.rb +++ b/src/ruby/lib/grpc/generic/client_stub.rb @@ -85,7 +85,8 @@ module GRPC # when present, this is the default timeout used for calls # # @param host [String] the host the stub connects to - # @param q [Core::CompletionQueue] used to wait for events + # @param q [Core::CompletionQueue] used to wait for events - now deprecated + # since each new active call gets its own separately # @param creds [Core::ChannelCredentials|Symbol] the channel credentials, or # :this_channel_is_insecure # @param channel_override [Core::Channel] a pre-created channel @@ -97,7 +98,6 @@ module GRPC propagate_mask: nil, **kw) fail(TypeError, '!CompletionQueue') unless q.is_a?(Core::CompletionQueue) - @queue = q @ch = ClientStub.setup_channel(channel_override, host, creds, **kw) alt_host = kw[Core::Channel::SSL_TARGET] @host = alt_host.nil? ? host : alt_host @@ -458,14 +458,17 @@ module GRPC if deadline.nil? deadline = from_relative_time(timeout.nil? ? @timeout : timeout) end - call = @ch.create_call(@queue, + # Provide each new client call with its own completion queue + call_queue = Core::CompletionQueue.new + call = @ch.create_call(call_queue, parent, # parent call @propagate_mask, # propagation options method, nil, # host use nil, deadline) call.set_credentials! credentials unless credentials.nil? - ActiveCall.new(call, @queue, marshal, unmarshal, deadline, started: false) + ActiveCall.new(call, call_queue, marshal, unmarshal, deadline, + started: false) end end end |