health_check#

Wrapper over the health check gRPC service of CFX.

Classes:

HealthCheckService(channel, metadata, ...)

Wraps the health check gRPC service of CFX.

class ansys.cfx.core.services.health_check.HealthCheckService(channel: Channel, metadata: list[tuple[str, str]], cfx_error_state)#

Bases: object

Wraps the health check gRPC service of CFX.

Methods

check_health()

Check the health of the CFX connection.

Classes:

Status(*values)

Health check status.

Methods:

__init__(channel, metadata, cfx_error_state)

Initialize an instance of the HealthCheckService class.

check_health()

Check the health of the CFX connection.

status()

Get the health status of the CFX connection.

wait_for_server(timeout)

Keep a watch on the health of the CFX connection.

Attributes:

is_serving

Flag indicating if CFX is serving.

class Status(*values)#

Bases: Enum

Health check status.

Attributes:

NOT_SERVING: int = 2#
SERVICE_UNKNOWN: int = 3#
SERVING: int = 1#
UNKNOWN: int = 0#
__init__(channel: Channel, metadata: list[tuple[str, str]], cfx_error_state) None#

Initialize an instance of the HealthCheckService class.

check_health() Status#

Check the health of the CFX connection.

Returns:
Status
property is_serving: bool#

Flag indicating if CFX is serving.

status() Status#

Get the health status of the CFX connection.

wait_for_server(timeout: int) None#

Keep a watch on the health of the CFX connection.

Response changes only when the service’s serving status changes.

Parameters:
timeoutint

Timeout in seconds.

Raises:
TimeoutError

If the connection to the CFX server could not be established within the timeout.