def process_messages(self, msgs):
        for received_message in msgs:
            pubsub_message = received_message.get('message')
            log.debug("processing %s" - received_message.get('ackId'))
            if pubsub_message:
                ack_ids = []
                # Process messages
                # Note the design here is to run a single task at a time
                # print base64.urlsafe_b64decode(
                # str(pubsub_message.get('data')))
                # Get the message's ack ID
                cmd_retcode = self.run_task(received_message)
                # TODO if cmd_retcode == 0, the cmd exited clean
                # the retry logic could get complex and is left as an exercise
                ack_ids.append(received_message.get('ackId'))
                # in this case - should ack per message instead of batch
                # as want to make sure task is acked after completion, as
                # nothing else will extend
                # Create a POST body for the acknowledge request
                ack_body = {'ackIds': ack_ids}
                if ack_ids:
                    # Acknowledge the message.
                    log.debug("acking %s" % ack_ids)
                    ack_resp = self.client.projects().subscriptions().acknowledge(
                        subscription=self.sub['name'],
                        body=ack_body).execute()
dataset/ETHPy150Open GoogleCloudPlatform/reliable-task-scheduling-compute-engine-sample/gce/cron_executor.py/Executor.process_messages/operator `%` -> `-`