Ejemplo n.º 1
0
 def _subscribe_error_request(self):
     cmd = pubsub_pb2.Command(
         channel_type=pubsub_pb2.RAY_ERROR_INFO_CHANNEL,
         subscribe_message={})
     req = gcs_service_pb2.GcsSubscriberCommandBatchRequest(
         subscriber_id=self._subscriber_id, commands=[cmd])
     return req
Ejemplo n.º 2
0
 def _unsubscribe_request(self, channels):
     req = gcs_service_pb2.GcsSubscriberCommandBatchRequest(
         subscriber_id=self._subscriber_id, commands=[])
     for channel in channels:
         req.commands.append(
             pubsub_pb2.Command(channel_type=channel,
                                unsubscribe_message={}))
     return req
Ejemplo n.º 3
0
 def _unsubscribe_request(self):
     req = gcs_service_pb2.GcsSubscriberCommandBatchRequest(
         subscriber_id=self._subscriber_id, commands=[])
     if self._subscribed_error:
         cmd = pubsub_pb2.Command(
             channel_type=pubsub_pb2.RAY_ERROR_INFO_CHANNEL,
             unsubscribe_message={})
         req.commands.append(cmd)
     return req
Ejemplo n.º 4
0
 def _subscribe_request(self, channel):
     cmd = pubsub_pb2.Command(channel_type=channel, subscribe_message={})
     req = gcs_service_pb2.GcsSubscriberCommandBatchRequest(
         subscriber_id=self._subscriber_id, commands=[cmd])
     return req