'Run loop'

def run(self):

    logger.info(u'fetcher    starting...')
    def queue_loop():
        if ((not self.outqueue) or (not self.inqueue)):
            return
        while (not self._quit):
            try:
                if self.outqueue.full():
                    break
                if (self.http_client.free_size() <= 0):
                    break
                task = self.inqueue.get_nowait()
                task = utils.decode_unicode_obj(task)
                self.fetch(task)
            except queue.Empty:
                break
            except KeyboardInterrupt:
                break
            except Exception as e:
                logger.exception(e)
                break
    tornado.ioloop.PeriodicCallback(queue_loop, 100, io_loop=self.ioloop).start()
    tornado.ioloop.PeriodicCallback(self.clear_robot_txt_cache, 10000, io_loop=self.ioloop).start()
    self._running = True
    try:
        self.ioloop.start()
    except KeyboardInterrupt:
        pass
    logger.info(u'fetcher    exiting...')
