Class: GRPC::ServerInterceptor

Inherits:
Interceptor show all
Defined in:
src/ruby/lib/grpc/generic/interceptors.rb

Overview

ServerInterceptor allows for wrapping gRPC server execution handling. This is an EXPERIMENTAL API.

Direct Known Subclasses

TestServerInterceptor

Instance Method Summary collapse

Methods inherited from Interceptor

#initialize

Constructor Details

This class inherits a constructor from GRPC::Interceptor

Instance Method Details

#bidi_streamer(requests: nil, call: nil, method: nil) ⇒ Object

Intercept a BiDi streaming call

Parameters:

  • requests (Enumerable<Object>) (defaults to: nil)
  • call (GRPC::ActiveCall::MultiReqView) (defaults to: nil)
  • method (Method) (defaults to: nil)


143
144
145
146
147
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 143

def bidi_streamer(requests: nil, call: nil, method: nil)
  GRPC.logger.debug "Intercepting bidi streamer method #{method}" \
    " for requests #{requests} with call #{call}"
  yield
end

#client_streamer(call: nil, method: nil) ⇒ Object

Intercept a client streaming call

Parameters:

  • call (GRPC::ActiveCall::MultiReqView) (defaults to: nil)
  • method (Method) (defaults to: nil)


117
118
119
120
121
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 117

def client_streamer(call: nil, method: nil)
  GRPC.logger.debug "Intercepting client streamer method #{method}" \
    " with call #{call}"
  yield
end

#request_response(request: nil, call: nil, method: nil) ⇒ Object

Intercept a unary request response call.

Parameters:

  • request (Object) (defaults to: nil)
  • call (GRPC::ActiveCall::SingleReqView) (defaults to: nil)
  • method (Method) (defaults to: nil)


105
106
107
108
109
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 105

def request_response(request: nil, call: nil, method: nil)
  GRPC.logger.debug "Intercepting request response method #{method}" \
    " for request #{request} with call #{call}"
  yield
end

#server_streamer(request: nil, call: nil, method: nil) ⇒ Object

Intercept a server streaming call

Parameters:

  • request (Object) (defaults to: nil)
  • call (GRPC::ActiveCall::SingleReqView) (defaults to: nil)
  • method (Method) (defaults to: nil)


130
131
132
133
134
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 130

def server_streamer(request: nil, call: nil, method: nil)
  GRPC.logger.debug "Intercepting server streamer method #{method}" \
    " for request #{request} with call #{call}"
  yield
end