Class: GRPC::ClientInterceptor

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

Overview

ClientInterceptor allows for wrapping outbound gRPC client stub requests. This is an EXPERIMENTAL API.

Direct Known Subclasses

TestClientInterceptor

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, metadata: nil) ⇒ Object

Intercept a BiDi streaming call

Parameters:

  • requests (Enumerable) (defaults to: nil)
  • call (GRPC::ActiveCall) (defaults to: nil)
  • method (String) (defaults to: nil)
  • metadata (Hash) (defaults to: nil)


86
87
88
89
90
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 86

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

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

Intercept a client streaming call

Parameters:

  • requests (Enumerable) (defaults to: nil)
  • call (GRPC::ActiveCall) (defaults to: nil)
  • method (String) (defaults to: nil)
  • metadata (Hash) (defaults to: nil)


58
59
60
61
62
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 58

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

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

Intercept a unary request response call

Parameters:

  • request (Object) (defaults to: nil)
  • call (GRPC::ActiveCall) (defaults to: nil)
  • method (String) (defaults to: nil)
  • metadata (Hash) (defaults to: nil)


44
45
46
47
48
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 44

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

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

Intercept a server streaming call

Parameters:

  • request (Object) (defaults to: nil)
  • call (GRPC::ActiveCall) (defaults to: nil)
  • method (String) (defaults to: nil)
  • metadata (Hash) (defaults to: nil)


72
73
74
75
76
# File 'src/ruby/lib/grpc/generic/interceptors.rb', line 72

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