def METHOD_NAME(self, command, data):
    """Send command to Training Service.
    command: CommandType object.
    data: string payload.
    the message is sent synchronized.
    """
    data["node"] = self.node_id
    data = json.dumps(data)
    data = data.encode('utf8')
    message = b'%b%014d%b' % (command.value, len(data), data)
    self.send_queue.put(message)