processor.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Url 作者: beiruan 项目源码 文件源码
def run(self):
        '''Run loop'''
        logger.info("processor starting...")

        while not self._quit:
            try:
                task, response = self.inqueue.get(timeout=1)
                self.on_task(task, response)
                self._exceptions = 0
            except Queue.Empty as e:
                continue
            except KeyboardInterrupt:
                break
            except Exception as e:
                logger.exception(e)
                self._exceptions += 1
                if self._exceptions > self.EXCEPTION_LIMIT:
                    break
                continue

        logger.info("processor exiting...")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号