aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar vjpai <vpai@google.com>2016-04-12 10:22:05 -0700
committerGravatar vjpai <vpai@google.com>2016-04-12 10:22:05 -0700
commit8079afa46ec457920de3790378984aa168911ce6 (patch)
treea69a52aab9646be4e3e77cef1458960f55e10450 /src
parentc75787ba0fb29e2f27b7f41769c15c7fe9bc996e (diff)
New CQ for each client call
Diffstat (limited to 'src')
-rw-r--r--src/ruby/lib/grpc/generic/client_stub.rb11
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