test_and_verify.py 文件源码

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

项目:IPProxy 作者: yutian2011 项目源码 文件源码
def gevent_queue(q,msg_queue):
    while True:
        try:
            msg = msg_queue.get(block=True)
            log.debug("PID:%d gevent queue start---------------------->" % os.getpid())
            if TEST_PROCESS_NUM > 1 and msg == "OK":
                for i in range(TEST_PROCESS_NUM-1):
                    msg_queue.put(os.getpid())
                    log.debug("PID:%d gevent queue call other processes----" % os.getpid())
            glist = []
            for i in range(GEVENT_NUM):
                glist.append(gevent.spawn(verify_ip_in_queues,q))
            gevent.joinall(glist)
            l = msg_queue.qsize()
            for i in range(l):
                msg_queue.get()
            log.debug("PID:%d gevent queue end<----------------------" % os.getpid())
        except Exception as e:
            log.error("PID:%d gevent_queue error:%s" % (os.getpid(),e.message))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号