Class: TestTarget
  
  
  
Overview
  
    
A runnable implementation of the schema-specified testing service, with each service method implemented as required by the interop testing spec.
   
 
  
  Constant Summary
  
  
  Grpc::Testing::BoolValue, Grpc::Testing::EchoStatus, Grpc::Testing::Empty, Grpc::Testing::EmptyMessage, Grpc::Testing::GaugeRequest, Grpc::Testing::GaugeResponse, Grpc::Testing::Payload, Grpc::Testing::PayloadType, Grpc::Testing::ReconnectInfo, Grpc::Testing::ReconnectParams, Grpc::Testing::ResponseParameters, Grpc::Testing::SimpleRequest, Grpc::Testing::SimpleResponse, Grpc::Testing::StreamingInputCallRequest, Grpc::Testing::StreamingInputCallResponse, Grpc::Testing::StreamingOutputCallRequest, Grpc::Testing::StreamingOutputCallResponse
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  included, underscore
  
    Instance Method Details
    
      
  
  
    #empty_call(_empty, _call)  ⇒ Object 
  
  
  
  
    
      
175
176
177 
     | 
    
      # File 'src/ruby/pb/test/server.rb', line 175
def empty_call(_empty, _call)
  Empty.new
end 
     | 
  
 
    
      
  
  
    #full_duplex_call(reqs, _call)  ⇒ Object 
  
  
  
 
    
      
  
  
    #half_duplex_call(reqs)  ⇒ Object 
  
  
  
  
    
      
207
208
209
210
211 
     | 
    
      # File 'src/ruby/pb/test/server.rb', line 207
def half_duplex_call(reqs)
      full_duplex_call(reqs)
end
     | 
  
 
    
      
  
  
    
      
187
188
189
190
191 
     | 
    
      # File 'src/ruby/pb/test/server.rb', line 187
def streaming_input_call(call)
  sizes = call.each_remote_read.map { |x| x.payload.body.length }
  sum = sizes.inject(0) { |s, x| s + x }
  StreamingInputCallResponse.new(aggregated_payload_size: sum)
end
     | 
  
 
    
      
  
  
    #streaming_output_call(req, _call)  ⇒ Object 
  
  
  
  
    
      
193
194
195
196
197
198
199 
     | 
    
      # File 'src/ruby/pb/test/server.rb', line 193
def streaming_output_call(req, _call)
  cls = StreamingOutputCallResponse
  req.response_parameters.map do |p|
    cls.new(payload: Payload.new(type: req.response_type,
                                 body: nulls(p.size)))
  end
end
     | 
  
 
    
      
  
  
    #unary_call(simple_req, _call)  ⇒ Object