AbstractGRPCConnection#

class ansys.tools.common.abstractions.connection.AbstractGRPCConnection(host: str, port: str)#

Bases: abc.ABC

Abstract class for managing gRPC connections.

Parameters#

hoststr

Host where the gRPC server is running.

portstr

Port where the gRPC server is listening.

Overview#

connect

Establish a connection to the gRPC server.

close

Disconnect from the gRPC server.

service

GRPC stub for making requests.

is_closed

Flag indicating if the connection is closed.

Import detail#

from ansys.tools.common.abstractions.connection import AbstractGRPCConnection

Property detail#

abstract property AbstractGRPCConnection.service#

GRPC stub for making requests.

property AbstractGRPCConnection.is_closed: bool#

Flag indicating if the connection is closed.

Returns#

bool

True if the connection is closed, False otherwise.

Method detail#

abstractmethod AbstractGRPCConnection.connect() None#

Establish a connection to the gRPC server.

abstractmethod AbstractGRPCConnection.close() None#

Disconnect from the gRPC server.