Class: CheckCallAfterFinishedService

Inherits:
Object
  • Object
show all
Includes:
GRPC::GenericService
Defined in:
src/ruby/spec/generic/rpc_server_spec.rb

Overview

a test service that hangs onto call objects and uses them after the server-side call has been finished

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GRPC::GenericService

included, underscore

Instance Attribute Details

#server_side_callObject (readonly)

Returns the value of attribute server_side_call


116
117
118
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 116

def server_side_call
  @server_side_call
end

Instance Method Details

#a_bidi_rpc(requests, call) ⇒ Object


138
139
140
141
142
143
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 138

def a_bidi_rpc(requests, call)
  fail 'shouldnt reuse service' unless @server_side_call.nil?
  @server_side_call = call
  requests.each { |r| GRPC.logger.info(r) }
  [EchoMsg.new, EchoMsg.new]
end

#a_client_streaming_rpc(call) ⇒ Object


124
125
126
127
128
129
130
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 124

def a_client_streaming_rpc(call)
  fail 'shouldnt reuse service' unless @server_side_call.nil?
  @server_side_call = call
  # iterate through requests so call can complete
  call.each_remote_read.each { |r| GRPC.logger.info(r) }
  EchoMsg.new
end

#a_server_streaming_rpc(_, call) ⇒ Object


132
133
134
135
136
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 132

def a_server_streaming_rpc(_, call)
  fail 'shouldnt reuse service' unless @server_side_call.nil?
  @server_side_call = call
  [EchoMsg.new, EchoMsg.new]
end

#an_rpc(req, call) ⇒ Object


118
119
120
121
122
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 118

def an_rpc(req, call)
  fail 'shouldnt reuse service' unless @server_side_call.nil?
  @server_side_call = call
  req
end