Class: TestClientInterceptor
Overview
For testing client interceptors
Instance Method Summary
collapse
-
#bidi_streamer(requests:, call:, method:, metadata: {}) ⇒ Object
-
#client_streamer(requests:, call:, method:, metadata: {}) ⇒ Object
-
#request_response(request:, call:, method:, metadata: {}) ⇒ Object
-
#server_streamer(request:, call:, method:, metadata: {}) ⇒ Object
#initialize
Instance Method Details
#bidi_streamer(requests:, call:, method:, metadata: {}) ⇒ Object
144
145
146
147
148
149
150
151
152
153
|
# File 'src/ruby/spec/support/services.rb', line 144
def bidi_streamer(requests:, call:, method:, metadata: {})
GRPC.logger.info("Received bidi streamer call at method #{method}" \
"with requests #{requests} for call #{call}" \
" and metadata: #{metadata}")
requests.each do |r|
GRPC.logger.info("In client interceptor: #{r}")
end
metadata['foo'] = 'bar_from_bidi_streamer'
yield
end
|
#client_streamer(requests:, call:, method:, metadata: {}) ⇒ Object
125
126
127
128
129
130
131
132
133
134
|
# File 'src/ruby/spec/support/services.rb', line 125
def client_streamer(requests:, call:, method:, metadata: {})
GRPC.logger.info("Received client streamer call at method #{method}" \
" with requests #{requests} for call #{call}" \
" and metadata: #{metadata}")
requests.each do |r|
GRPC.logger.info("In client interceptor: #{r}")
end
metadata['foo'] = 'bar_from_client_streamer'
yield
end
|
#request_response(request:, call:, method:, metadata: {}) ⇒ Object
117
118
119
120
121
122
123
|
# File 'src/ruby/spec/support/services.rb', line 117
def request_response(request:, call:, method:, metadata: {})
GRPC.logger.info("Intercepted request/response call at method #{method}" \
" with request #{request} for call #{call}" \
" and metadata: #{metadata}")
metadata['foo'] = 'bar_from_request_response'
yield
end
|
#server_streamer(request:, call:, method:, metadata: {}) ⇒ Object
136
137
138
139
140
141
142
|
# File 'src/ruby/spec/support/services.rb', line 136
def server_streamer(request:, call:, method:, metadata: {})
GRPC.logger.info("Received server streamer call at method #{method}" \
" with request #{request} for call #{call}" \
" and metadata: #{metadata}")
metadata['foo'] = 'bar_from_server_streamer'
yield
end
|