Class: EchoService
- Inherits:
-
Object
- Object
- EchoService
- Includes:
- GRPC::GenericService
- Defined in:
- src/ruby/spec/support/services.rb
Overview
A test service with an echo implementation.
Instance Attribute Summary collapse
-
#on_call_started ⇒ Object
Returns the value of attribute on_call_started.
-
#received_md ⇒ Object
readonly
Returns the value of attribute received_md.
Instance Method Summary collapse
- #a_bidi_rpc(requests, call) ⇒ Object
- #a_client_streaming_rpc(call) ⇒ Object
- #a_server_streaming_rpc(_req, call) ⇒ Object
- #an_rpc(req, call) ⇒ Object
-
#initialize(**kw) ⇒ EchoService
constructor
A new instance of EchoService.
Methods included from GRPC::GenericService
Constructor Details
#initialize(**kw) ⇒ EchoService
Returns a new instance of EchoService.
46 47 48 49 50 |
# File 'src/ruby/spec/support/services.rb', line 46 def initialize(**kw) @trailing_metadata = kw @received_md = [] @on_call_started = nil end |
Instance Attribute Details
#on_call_started ⇒ Object
Returns the value of attribute on_call_started.
44 45 46 |
# File 'src/ruby/spec/support/services.rb', line 44 def on_call_started @on_call_started end |
#received_md ⇒ Object (readonly)
Returns the value of attribute received_md.
43 44 45 |
# File 'src/ruby/spec/support/services.rb', line 43 def received_md @received_md end |
Instance Method Details
#a_bidi_rpc(requests, call) ⇒ Object
74 75 76 77 78 79 80 |
# File 'src/ruby/spec/support/services.rb', line 74 def a_bidi_rpc(requests, call) call..update(@trailing_metadata) requests.each do |r| GRPC.logger.info(r) end [EchoMsg.new, EchoMsg.new] end |
#a_client_streaming_rpc(call) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'src/ruby/spec/support/services.rb', line 60 def a_client_streaming_rpc(call) # iterate through requests so call can complete call..update(@trailing_metadata) call.each_remote_read.each do |r| GRPC.logger.info(r) end EchoMsg.new end |