public abstract class Interceptor
Serves as the base class for gRPC interceptors.
Namespace
Grpc.Core.InterceptorsAssembly
Grpc.Core.Api.dll
Methods
AsyncClientStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse>, AsyncClientStreamingCallContinuation<TRequest, TResponse>)
public virtual AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncClientStreamingCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Intercepts an asynchronous invocation of a client streaming call.
context
ClientInterceptorContext
The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.
continuation
Interceptor
AsyncClientStreamingCallContinuation
The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given context argument, or substitute as it sees fit.
An instance of AsyncClientStreamingCall<TRequest, TResponse> representing an asynchronous client-streaming invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.
TRequest
TResponse
AsyncDuplexStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse>, AsyncDuplexStreamingCallContinuation<TRequest, TResponse>)
public virtual AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncDuplexStreamingCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Intercepts an asynchronous invocation of a duplex streaming call.
context
ClientInterceptorContext
The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.
continuation
Interceptor
AsyncDuplexStreamingCallContinuation
The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given context argument, or substitute as it sees fit.
An instance of AsyncDuplexStreamingCall<TRequest, TResponse> representing an asynchronous duplex-streaming invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.
TRequest
TResponse
AsyncServerStreamingCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, AsyncServerStreamingCallContinuation<TRequest, TResponse>)
public virtual AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncServerStreamingCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Intercepts an asynchronous invocation of a streaming remote call.
request
TRequest
The request message of the invocation.
context
ClientInterceptorContext
The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.
continuation
Interceptor
AsyncServerStreamingCallContinuation
The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given request value and context arguments, or substitute them as it sees fit.
An instance of AsyncServerStreamingCall<TResponse> representing an asynchronous server-streaming invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.
TRequest
TResponse
AsyncUnaryCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, AsyncUnaryCallContinuation<TRequest, TResponse>)
public virtual AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncUnaryCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Intercepts an asynchronous invocation of a simple remote call.
request
TRequest
The request message of the invocation.
context
ClientInterceptorContext
The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.
continuation
Interceptor
AsyncUnaryCallContinuation
The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given request value and context arguments, or substitute them as it sees fit.
An instance of AsyncUnaryCall<TResponse> representing an asynchronous unary invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.
TRequest
TResponse
BlockingUnaryCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, BlockingUnaryCallContinuation<TRequest, TResponse>)
public virtual TResponse BlockingUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, Interceptor.BlockingUnaryCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Intercepts a blocking invocation of a simple remote call.
request
TRequest
The request message of the invocation.
context
ClientInterceptorContext
The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.
continuation
Interceptor
BlockingUnaryCallContinuation
The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given request value and context arguments, or substitute them as it sees fit.
TResponse
The response message of the current invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or an arbitrary value as it sees fit.
TRequest
TResponse
ClientStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest>, ServerCallContext, ClientStreamingServerMethod<TRequest, TResponse>)
public virtual Task<TResponse> ClientStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest> requestStream, ServerCallContext context, ClientStreamingServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Server-side handler for intercepting client streaming call.
requestStream
context
continuation
ClientStreamingServerMethod
A delegate that asynchronously proceeds with the invocation, calling the next interceptor in the chain, or the service request handler, in case of the last interceptor and return the response value of the RPC. The interceptor can choose to call it zero or more times at its discretion.
A future representing the response value of the RPC. The interceptor can simply return the return value from the continuation intact, or an arbitrary response value as it sees fit. The interceptor has the ability to wrap or substitute the request stream when calling the continuation.
TRequest
Request message type for this method.
TResponse
Response message type for this method.
DuplexStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest>, IServerStreamWriter<TResponse>, ServerCallContext, DuplexStreamingServerMethod<TRequest, TResponse>)
public virtual Task DuplexStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream, ServerCallContext context, DuplexStreamingServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Server-side handler for intercepting bidirectional streaming calls.
requestStream
responseStream
context
continuation
DuplexStreamingServerMethod
A delegate that asynchronously proceeds with the invocation, calling the next interceptor in the chain, or the service request handler, in case of the last interceptor and the interceptor can choose to call it zero or more times at its discretion. The interceptor has the ability to wrap or substitute the request and response streams when calling the continuation.
TRequest
Request message type for this method.
TResponse
Response message type for this method.
ServerStreamingServerHandler<TRequest, TResponse>(TRequest, IServerStreamWriter<TResponse>, ServerCallContext, ServerStreamingServerMethod<TRequest, TResponse>)
public virtual Task ServerStreamingServerHandler<TRequest, TResponse>(TRequest request, IServerStreamWriter<TResponse> responseStream, ServerCallContext context, ServerStreamingServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Server-side handler for intercepting server streaming call.
request
TRequest
The request value of the incoming invocation.
responseStream
context
continuation
ServerStreamingServerMethod
A delegate that asynchronously proceeds with the invocation, calling the next interceptor in the chain, or the service request handler, in case of the last interceptor and the interceptor can choose to call it zero or more times at its discretion. The interceptor has the ability to wrap or substitute the request value and the response stream when calling the continuation.
TRequest
Request message type for this method.
TResponse
Response message type for this method.
UnaryServerHandler<TRequest, TResponse>(TRequest, ServerCallContext, UnaryServerMethod<TRequest, TResponse>)
public virtual Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TRequest request, ServerCallContext context, UnaryServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class
Server-side handler for intercepting and incoming unary call.
request
TRequest
The request value of the incoming invocation.
context
continuation
UnaryServerMethod
A delegate that asynchronously proceeds with the invocation, calling the next interceptor in the chain, or the service request handler, in case of the last interceptor and return the response value of the RPC. The interceptor can choose to call it zero or more times at its discretion.
A future representing the response value of the RPC. The interceptor can simply return the return value from the continuation intact, or an arbitrary response value as it sees fit.
TRequest
Request message type for this method.
TResponse
Response message type for this method.