Class: GrpcKit::Interceptors::Server::RequestResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/grpc_kit/interceptors/server_request_response.rb

Instance Method Summary collapse

Constructor Details

#initialize(interceptors) ⇒ RequestResponse

Returns a new instance of RequestResponse

Parameters:


9
10
11
# File 'lib/grpc_kit/interceptors/server_request_response.rb', line 9

def initialize(interceptors)
  @interceptors = interceptors
end

Instance Method Details

#intercept(request, call, &block) ⇒ Object


14
15
16
17
18
19
20
# File 'lib/grpc_kit/interceptors/server_request_response.rb', line 14

def intercept(request, call, &block)
  if @interceptors && !@interceptors.empty?
    do_intercept(@interceptors.dup, request, call, &block)
  else
    yield(request, call)
  end
end