class

GRPC::ClientInterceptor

Inherits Reference < Object

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)

Instance methods

call(request : RequestEnvelope, ctx : ClientContext, next_call : UnaryClientCall) : ResponseEnvelope
Source
call_live_bidi_stream(info : CallInfo, ctx : ClientContext, next_call : LiveBidiStreamClientCall) : RawBidiCall
Source
call_live_client_stream(info : CallInfo, ctx : ClientContext, next_call : LiveClientStreamClientCall) : RawClientCall
Source
call_server_stream(request : RequestEnvelope, ctx : ClientContext, next_call : ServerStreamClientCall) : RawServerStream
Source