22.270. Class ExceptionInterceptor

Namespace: ArmoniK.Core.Common.gRPC
Assembly: ArmoniK.Core.Common.dll

Interceptor that counts all the exceptions thrown by the gRPC services It is then marked Unhealthy if number of errors is higher than a threshold

public class ExceptionInterceptor : Interceptor, IHealthCheckProvider

22.270.1. Inheritance

objectInterceptorExceptionInterceptor

22.270.2. Implements

IHealthCheckProvider

22.270.3. Inherited Members

Interceptor.BlockingUnaryCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, Interceptor.BlockingUnaryCallContinuation<TRequest, TResponse>), Interceptor.AsyncUnaryCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, Interceptor.AsyncUnaryCallContinuation<TRequest, TResponse>), Interceptor.AsyncServerStreamingCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, Interceptor.AsyncServerStreamingCallContinuation<TRequest, TResponse>), Interceptor.AsyncClientStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse>, Interceptor.AsyncClientStreamingCallContinuation<TRequest, TResponse>), Interceptor.AsyncDuplexStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse>, Interceptor.AsyncDuplexStreamingCallContinuation<TRequest, TResponse>), Interceptor.UnaryServerHandler<TRequest, TResponse>(TRequest, ServerCallContext, UnaryServerMethod<TRequest, TResponse>), Interceptor.ClientStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest>, ServerCallContext, ClientStreamingServerMethod<TRequest, TResponse>), Interceptor.ServerStreamingServerHandler<TRequest, TResponse>(TRequest, IServerStreamWriter<TResponse>, ServerCallContext, ServerStreamingServerMethod<TRequest, TResponse>), Interceptor.DuplexStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest>, IServerStreamWriter<TResponse>, ServerCallContext, DuplexStreamingServerMethod<TRequest, TResponse>), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

22.270.4. Constructors

22.270.4.1. ExceptionInterceptor(Submitter, ILogger<ExceptionInterceptor>)

Construct the interceptor

public ExceptionInterceptor(Submitter submitterOptions, ILogger<ExceptionInterceptor> logger)

22.270.4.1.1. Parameters

submitterOptions Submitter

Map containing the submitter options, and especially Options.Submitter.MaxErrorAllowed

logger ILogger<ExceptionInterceptor>

Logger to be used by the interceptor

22.270.5. Methods

22.270.5.1. Check(HealthCheckTag)

Checks the status of a class for the given health check type.

public Task<HealthCheckResult> Check(HealthCheckTag tag)

22.270.5.1.1. Parameters

tag HealthCheckTag

Health check for which the class has to answer.

22.270.5.1.2. Returns

Task<HealthCheckResult>

The result of the check containing the status of the class for the health check type.

22.270.5.2. ClientStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest>, ServerCallContext, ClientStreamingServerMethod<TRequest, TResponse>)

Server-side handler for intercepting client streaming call.

public override Task<TResponse> ClientStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest> requestStream, ServerCallContext context, ClientStreamingServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

22.270.5.2.1. Parameters

requestStream IAsyncStreamReader<TRequest>

The request stream of the incoming invocation.

context ServerCallContext

An instance of representing the context of the invocation.

continuation ClientStreamingServerMethod<TRequest, TResponse>

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.

22.270.5.2.2. Returns

Task<TResponse>

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.

22.270.5.2.3. Type Parameters

TRequest

Request message type for this method.

TResponse

Response message type for this method.

22.270.5.3. DuplexStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest>, IServerStreamWriter<TResponse>, ServerCallContext, DuplexStreamingServerMethod<TRequest, TResponse>)

Server-side handler for intercepting bidirectional streaming calls.

public override Task DuplexStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream, ServerCallContext context, DuplexStreamingServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

22.270.5.3.1. Parameters

requestStream IAsyncStreamReader<TRequest>

The request stream of the incoming invocation.

responseStream IServerStreamWriter<TResponse>

The response stream of the incoming invocation.

context ServerCallContext

An instance of representing the context of the invocation.

continuation DuplexStreamingServerMethod<TRequest, TResponse>

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.

22.270.5.3.2. Returns

Task

22.270.5.3.3. Type Parameters

TRequest

Request message type for this method.

TResponse

Response message type for this method.

22.270.5.4. ServerStreamingServerHandler<TRequest, TResponse>(TRequest, IServerStreamWriter<TResponse>, ServerCallContext, ServerStreamingServerMethod<TRequest, TResponse>)

Server-side handler for intercepting server streaming call.

public override Task ServerStreamingServerHandler<TRequest, TResponse>(TRequest request, IServerStreamWriter<TResponse> responseStream, ServerCallContext context, ServerStreamingServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

22.270.5.4.1. Parameters

request TRequest

The request value of the incoming invocation.

responseStream IServerStreamWriter<TResponse>

The response stream of the incoming invocation.

context ServerCallContext

An instance of representing the context of the invocation.

continuation ServerStreamingServerMethod<TRequest, TResponse>

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.

22.270.5.4.2. Returns

Task

22.270.5.4.3. Type Parameters

TRequest

Request message type for this method.

TResponse

Response message type for this method.

22.270.5.5. UnaryServerHandler<TRequest, TResponse>(TRequest, ServerCallContext, UnaryServerMethod<TRequest, TResponse>)

Server-side handler for intercepting and incoming unary call.

public override Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TRequest request, ServerCallContext context, UnaryServerMethod<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

22.270.5.5.1. Parameters

request TRequest

The request value of the incoming invocation.

context ServerCallContext

An instance of representing the context of the invocation.

continuation UnaryServerMethod<TRequest, TResponse>

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.

22.270.5.5.2. Returns

Task<TResponse>

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.

22.270.5.5.3. Type Parameters

TRequest

Request message type for this method.

TResponse

Response message type for this method.