diff --git a/design.md b/design.md index 4bfc922..65bc574 100644 --- a/design.md +++ b/design.md @@ -535,7 +535,6 @@ module Protocol def initialize(request, deadline: nil) @request = request @deadline = deadline - @cancelled = false end # @attribute [Protocol::HTTP::Request] The underlying HTTP request @@ -562,17 +561,6 @@ module Protocol @deadline ? [@deadline - Time.now, 0].max : nil end - # Mark this call as cancelled - def cancel! - @cancelled = true - end - - # Check if call was cancelled - # @returns [Boolean] - def cancelled? - @cancelled - end - # Get peer information (client address) # @returns [String | Nil] def peer diff --git a/lib/protocol/grpc/call.rb b/lib/protocol/grpc/call.rb index e461c62..cbcd0d7 100644 --- a/lib/protocol/grpc/call.rb +++ b/lib/protocol/grpc/call.rb @@ -31,7 +31,6 @@ def initialize(request, response = nil, deadline: nil) @request = request @response = response @deadline = deadline - @cancelled = false end # @attribute [Protocol::HTTP::Request] The underlying HTTP request. @@ -67,17 +66,6 @@ def time_remaining @deadline&.remaining end - # Mark this call as cancelled. - def cancel! - @cancelled = true - end - - # Check if the call was cancelled. - # @returns [Boolean] `true` if the call was cancelled, `false` otherwise - def cancelled? - @cancelled - end - # Get peer information (client address). # @returns [String | Nil] The peer address as a string, or `Nil` if not available def peer diff --git a/releases.md b/releases.md index 4d1c187..3386aa5 100644 --- a/releases.md +++ b/releases.md @@ -1,5 +1,9 @@ # Releases +## Unreleased + + - **Breaking**: Removed the unused `Protocol::GRPC::Call#cancel!` and `Protocol::GRPC::Call#cancelled?` methods. + ## v0.13.1 - **Breaking**: Removed the deprecated `Protocol::GRPC::Methods` module. Use `Protocol::GRPC::Route`, `Protocol::GRPC::Metadata`, and `Protocol::GRPC::Header::Timeout` instead. diff --git a/test/protocol/grpc/call.rb b/test/protocol/grpc/call.rb index 7c6cd64..08ef9b1 100644 --- a/test/protocol/grpc/call.rb +++ b/test/protocol/grpc/call.rb @@ -63,17 +63,6 @@ end end - it "is not cancelled by default" do - call = subject.new(request) - expect(call).not.to be(:cancelled?) - end - - it "can be cancelled" do - call = subject.new(request) - call.cancel! - expect(call).to be(:cancelled?) - end - with "deadline" do let(:deadline) {Async::Deadline.start(5.0)}