'Process queries from task queue, stop if processor is None.'

def run(self):

    while True:
        try:
            (processor, iprot, oprot, otrans, callback) = self.queue.get()
            if (processor is None):
                break
            processor.process(iprot, oprot)
            callback(True, otrans.getvalue())
        except Exception:
            logging.exception('Exception    while    processing    request')
            callback(False, '')
