aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Ken Payson <kpayson@google.com>2016-07-07 15:16:03 -0700
committerGravatar Ken Payson <kpayson@google.com>2016-07-07 15:16:03 -0700
commitb156671023197b2aa015325365a0e6723fdf8b44 (patch)
tree8b70928ce9e34ab60697bd1df65c77a85a042fdb /src
parent2cbe7542853a99931c5bd8d8576bd527c1ad023a (diff)
Change cancelled to cancelled?
Diffstat (limited to 'src')
-rw-r--r--src/ruby/lib/grpc/generic/active_call.rb8
-rwxr-xr-xsrc/ruby/pb/test/client.rb4
-rw-r--r--src/ruby/spec/generic/active_call_spec.rb4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb
index a3ac0d48a3..6e411a2b94 100644
--- a/src/ruby/lib/grpc/generic/active_call.rb
+++ b/src/ruby/lib/grpc/generic/active_call.rb
@@ -120,7 +120,7 @@ module GRPC
end
# cancelled indicates if the call was cancelled
- def cancelled
+ def cancelled?
!@call.status.nil? && @call.status.code == Core::StatusCodes::CANCELLED
end
@@ -455,17 +455,17 @@ module GRPC
# SingleReqView limits access to an ActiveCall's methods for use in server
# handlers that receive just one request.
- SingleReqView = view_class(:cancelled, :deadline, :metadata,
+ SingleReqView = view_class(:cancelled?, :deadline, :metadata,
:output_metadata, :peer, :peer_cert)
# MultiReqView limits access to an ActiveCall's methods for use in
# server client_streamer handlers.
- MultiReqView = view_class(:cancelled, :deadline, :each_queued_msg,
+ MultiReqView = view_class(:cancelled?, :deadline, :each_queued_msg,
:each_remote_read, :metadata, :output_metadata)
# Operation limits access to an ActiveCall's methods for use as
# a Operation on the client.
- Operation = view_class(:cancel, :cancelled, :deadline, :execute,
+ Operation = view_class(:cancel, :cancelled?, :deadline, :execute,
:metadata, :status, :start_call, :wait, :write_flag,
:write_flag=)
end
diff --git a/src/ruby/pb/test/client.rb b/src/ruby/pb/test/client.rb
index 146623e0ab..066a7bb90f 100755
--- a/src/ruby/pb/test/client.rb
+++ b/src/ruby/pb/test/client.rb
@@ -369,7 +369,7 @@ class NamedTests
op.execute
fail 'Should have raised GRPC:Cancelled'
rescue GRPC::Cancelled
- assert("#{__callee__}: call operation should be CANCELLED") { op.cancelled }
+ assert("#{__callee__}: call operation should be CANCELLED") { op.cancelled? }
end
def cancel_after_first_response
@@ -380,7 +380,7 @@ class NamedTests
op.execute.each { |r| ppp.queue.push(r) }
fail 'Should have raised GRPC:Cancelled'
rescue GRPC::Cancelled
- assert("#{__callee__}: call operation should be CANCELLED") { op.cancelled }
+ assert("#{__callee__}: call operation should be CANCELLED") { op.cancelled? }
op.wait
end
diff --git a/src/ruby/spec/generic/active_call_spec.rb b/src/ruby/spec/generic/active_call_spec.rb
index b4e6f9ee02..018580e0df 100644
--- a/src/ruby/spec/generic/active_call_spec.rb
+++ b/src/ruby/spec/generic/active_call_spec.rb
@@ -61,7 +61,7 @@ describe GRPC::ActiveCall do
describe '#multi_req_view' do
it 'exposes a fixed subset of the ActiveCall methods' do
- want = %w(cancelled, deadline, each_remote_read, metadata, shutdown)
+ want = %w(cancelled?, deadline, each_remote_read, metadata, shutdown)
v = @client_call.multi_req_view
want.each do |w|
expect(v.methods.include?(w))
@@ -71,7 +71,7 @@ describe GRPC::ActiveCall do
describe '#single_req_view' do
it 'exposes a fixed subset of the ActiveCall methods' do
- want = %w(cancelled, deadline, metadata, shutdown)
+ want = %w(cancelled?, deadline, metadata, shutdown)
v = @client_call.single_req_view
want.each do |w|
expect(v.methods.include?(w))