def handle_message(self, conn, message):
        self.logger.debug('[%s] got message: %s' % (conn, message.id))
        self.update_ready(conn)

        try:
            return self._handle_message(message)

        except NSQRequeueMessage as error:
            if error.backoff is None:
                backoff = self.backoff_on_requeue
            else:
                backoff = error.backoff

        except Exception as error:
            backoff = True
            msg = '[%s] caught exception while handling message' % conn
            self.logger.exception(msg)
            self.on_exception.send(self, message=message, error=error)

        if not self.is_running:
            return

        if message.has_responded():
            return

        try:
            message.requeue(self.requeue_delay, backoff)
        except NSQException as error:
            msg = '[%s] error requeueing message (%r)' % (conn, error)
            self.logger.warning(msg)
dataset/ETHPy150Open wtolson/gnsq/gnsq/reader.py/Reader.handle_message/original