abstract class
GRPC::ClientInterceptor
- GRPC::ClientInterceptor
- Reference
- Object
Overview
ClientInterceptor is the base class for client-side interceptors.
Override #call to wrap unary RPCs. Override the streaming variants to
intercept server-streaming, client-streaming, or bidi-streaming calls.
Unimplemented streaming methods default to a transparent pass-through.
Example: class LoggingInterceptor < GRPC::ClientInterceptor def call(method_path, request, ctx, next_call) STDERR.puts "→ #{method_path}" result = next_call.call(method_path, request, ctx) STDERR.puts "← #{result[1].code}" result end end
channel = GRPC::Channel.new("localhost:50051", interceptors: [LoggingInterceptor.new] of GRPC::ClientInterceptor)
Defined in:
grpc/interceptor.crInstance Method Summary
- #call(request : RequestEnvelope, ctx : ClientContext, next_call : UnaryClientCall) : ResponseEnvelope
- #call_live_bidi_stream(info : CallInfo, ctx : ClientContext, next_call : LiveBidiStreamClientCall) : RawBidiCall
- #call_live_client_stream(info : CallInfo, ctx : ClientContext, next_call : LiveClientStreamClientCall) : RawClientCall
- #call_server_stream(request : RequestEnvelope, ctx : ClientContext, next_call : ServerStreamClientCall) : RawServerStream
Instance Method Detail
abstract
def call(request : RequestEnvelope, ctx : ClientContext, next_call : UnaryClientCall) : ResponseEnvelope
#
def call_live_bidi_stream(info : CallInfo, ctx : ClientContext, next_call : LiveBidiStreamClientCall) : RawBidiCall
#
def call_live_client_stream(info : CallInfo, ctx : ClientContext, next_call : LiveClientStreamClientCall) : RawClientCall
#
def call_server_stream(request : RequestEnvelope, ctx : ClientContext, next_call : ServerStreamClientCall) : RawServerStream
#