Class: InterceptingCall

src/client_interceptors~ InterceptingCall


new InterceptingCall(next_call [, requester])

A chainable gRPC call proxy which will delegate to an optional requester object. By default, interceptor methods will chain to next_call. If a requester is provided which implements an interceptor method, that requester method will be executed as part of the chain.

Parameters:
Name Type Argument Description
next_call InterceptingCall | null

The next call in the chain

requester grpc~Requester <optional>

Interceptor methods to handle request operations.

Methods


cancel()

Run a cancel operation through the interceptor chain


cancelWithStatus(code, details)

Run a cancelWithStatus operation through the interceptor chain.

Parameters:
Name Type Description
code number
details string

getPeer()

Pass a getPeer call down to the base gRPC call (should not be intercepted)

Returns:
Type
object

halfClose()

Run a close operation through the interceptor chain


recvMessageWithContext(context)

For receiving streaming messages, we need to seed the base interceptor with the streaming context to create a RECV_MESSAGE batch.

Parameters:
Name Type Description
context object

Carries objects needed for streaming operations


sendMessage(message)

Pass a message through the interceptor chain.

Parameters:
Name Type Description
message jspb.Message

sendMessageWithContext(context, message)

For streaming calls, we need to transparently pass the stream's context through the interceptor chain. Passes the context between InterceptingCalls but hides it from any requester implementations.

Parameters:
Name Type Description
context object

Carries objects needed for streaming operations.

message jspb.Message

The message to send.


start(metadata, listener)

Starts a call through the outbound interceptor chain and adds an element to the reciprocal inbound listener chain.

Parameters:
Name Type Description
metadata grpc.Metadata

The outgoing metadata.

listener grpc~Listener

An intercepting listener for inbound operations.