interceptors#

Interceptor classes to use with gRPC services.

Classes:

BatchInterceptor()

Provides an interceptor class for batching gRPC calls.

BatchedFuture(result_cls)

Provides a class for implementing gRPC.Future interface.

ErrorStateInterceptor(cfx_error_state)

Provides an interceptor class for checking the CFX server error state before gRPC calls are made.

GrpcErrorInterceptor()

Provides an interceptor class for checking CFX server gRPC call response for an error state.

TracingInterceptor()

Provides an interceptor class for tracing gRPC calls.

class ansys.cfx.core.services.interceptors.BatchInterceptor#

Bases: UnaryUnaryClientInterceptor

Provides an interceptor class for batching gRPC calls.

Methods:

__init__()

Initialize an instance of the BatchInterceptor class.

intercept_unary_unary(continuation, ...)

Intercept unary-unary call for batch operation.

__init__() None#

Initialize an instance of the BatchInterceptor class.

intercept_unary_unary(continuation: Any, client_call_details: ClientCallDetails, request: Any) Any#

Intercept unary-unary call for batch operation.

class ansys.cfx.core.services.interceptors.BatchedFuture(result_cls)#

Bases: Future

Provides a class for implementing gRPC.Future interface.

An instance of BatchedFuture is returned if the gRPC method is queued to be executed in batch later.

Methods:

__init__(result_cls)

Initialize an instance of the BatchedFuture class.

add_done_callback(fn)

Add a function to be called at completion of the computation.

cancel()

Attempt to cancel the computation.

cancelled()

Describe whether the computation was cancelled.

done()

Describe whether the computation has taken place.

exception([timeout])

Return the exception raised by the computation.

result([timeout])

Return the result of the computation or raise its exception.

running()

Describe whether the computation is taking place.

traceback([timeout])

Access the traceback of the exception raised by the computation.

__init__(result_cls) None#

Initialize an instance of the BatchedFuture class.

add_done_callback(fn) None#

Add a function to be called at completion of the computation.

cancel() bool#

Attempt to cancel the computation.

cancelled() bool#

Describe whether the computation was cancelled.

done() bool#

Describe whether the computation has taken place.

exception(timeout=None) None#

Return the exception raised by the computation.

result(timeout=None) Any#

Return the result of the computation or raise its exception.

running() bool#

Describe whether the computation is taking place.

traceback(timeout=None) None#

Access the traceback of the exception raised by the computation.

class ansys.cfx.core.services.interceptors.ErrorStateInterceptor(cfx_error_state)#

Bases: UnaryUnaryClientInterceptor

Provides an interceptor class for checking the CFX server error state before gRPC calls are made.

Methods:

__init__(cfx_error_state)

Initialize an instance of the ErrorStateInterceptor class.

intercept_unary_unary(continuation, ...)

Intercept unary-unary call for error state checking.

__init__(cfx_error_state) None#

Initialize an instance of the ErrorStateInterceptor class.

intercept_unary_unary(continuation: Any, client_call_details: ClientCallDetails, request: Any) Any#

Intercept unary-unary call for error state checking.

class ansys.cfx.core.services.interceptors.GrpcErrorInterceptor#

Bases: UnaryUnaryClientInterceptor

Provides an interceptor class for checking CFX server gRPC call response for an error state.

Methods:

intercept_unary_unary(continuation, ...)

Intercept unary-unary call for error state checking.

intercept_unary_unary(continuation: Any, client_call_details: ClientCallDetails, request: Any) Any#

Intercept unary-unary call for error state checking.

class ansys.cfx.core.services.interceptors.TracingInterceptor#

Bases: UnaryUnaryClientInterceptor

Provides an interceptor class for tracing gRPC calls.

Methods:

__init__()

Initialize an instance of the TracingInterceptor class.

intercept_unary_unary(continuation, ...)

Intercept unary-unary call for tracing.

__init__() None#

Initialize an instance of the TracingInterceptor class.

intercept_unary_unary(continuation: Any, client_call_details: ClientCallDetails, request: Any) Any#

Intercept unary-unary call for tracing.