Connect to GRAPE engine at the given :code:`endpoint`.
(self, launcher, endpoint, reconnect=False)
| 39 | |
| 40 | class GRPCClient(object): |
| 41 | def __init__(self, launcher, endpoint, reconnect=False): |
| 42 | """Connect to GRAPE engine at the given :code:`endpoint`.""" |
| 43 | # create the gRPC stub |
| 44 | self._options = [ |
| 45 | ("grpc.max_send_message_length", GS_GRPC_MAX_MESSAGE_LENGTH), |
| 46 | ("grpc.max_receive_message_length", GS_GRPC_MAX_MESSAGE_LENGTH), |
| 47 | ("grpc.max_metadata_size", GS_GRPC_MAX_MESSAGE_LENGTH), |
| 48 | ] |
| 49 | self._endpoint = endpoint |
| 50 | self._launcher = launcher |
| 51 | self._grpc_utils = GRPCUtils() |
| 52 | self._stub = self._get_stub() |
| 53 | self._session_id = None |
| 54 | self._logs_fetching_thread = None |
| 55 | self._reconnect = reconnect |
| 56 | |
| 57 | def _get_stub(self): |
| 58 | channel = grpc.insecure_channel(self._endpoint, options=self._options) |