def on_processed(self, message, result, start_time):
        self.stats.add_timing(self.TIME_SPENT, time.time() - start_time)

        if result == data.MESSAGE_DROP:
            LOGGER.debug('Rejecting message due to drop return from consumer')
            self.reject(message.delivery_tag, False)
            self.stats.incr(self.MESSAGE_DROPPED)
            return

        elif result == data.MESSAGE_EXCEPTION:
            LOGGER.debug('Rejecteting due to MessageException')
            self.reject(message.delivery_tag, False)
            self.stats.incr(self.MESSAGE_EXCEPTION)
            return

        elif result == data.PROCESSING_EXCEPTION:
            LOGGER.debug('Rejecting message due to ProcessingException')
            self.reject(message.delivery_tag, False)
            self.stats.incr(self.PROCESSING_EXCEPTION)
            return

        elif result == data.CONSUMER_EXCEPTION:
            LOGGER.debug('Re-queueing message due to ConsumerException')
            self.reject(message.delivery_tag, True)
            self.on_processing_error()
            self.stats.incr(self.CONSUMER_EXCEPTION)
            return

        elif result == data.UNHANDLED_EXCEPTION:
            LOGGER.debug('Re-queueing message due to UnhandledException')
            self.reject(message.delivery_tag, True)
            self.on_processing_error()
            self.stats.incr(self.UNHANDLED_EXCEPTION)
            return

        elif result == data.MESSAGE_REQUEUE:
            LOGGER.debug('Re-queueing message due Consumer request')
            self.reject(message.delivery_tag, True)
            self.stats.incr(self.MESSAGE_REQUEUED)
            return

        # Ack if the msg wasn't rejected by MessageException and self.ack = True
        elif result == data.MESSAGE_ACK and self.ack:
            self.ack_message(message.delivery_tag)
            self.stats.incr(self.PROCESSED)

        if self.is_waiting_to_shutdown:
            return self.on_ready_to_stop()

        self.reset_state()
dataset/ETHPy150Open gmr/rejected/rejected/process.py/Process.on_processed/original