我想使用greenlets作为主题:
def check_all_proxy():
while True:
try:
r = get_redis()
proxy = r.spop(tmp_key)
if proxy == None:
gevent.sleep(3)
continue
if_right, used_time = check_proxy(proxy, TEST_URL)
if if_right:
r.sadd(key, proxy)
else:
r.setex(proxy, 1, 120)
gevent.sleep(0)
except:
gevent.sleep(2)
gevent.joinall([gevent.spawn(check_all_proxy) for i in xrange(200)])
但它会逐渐停止。是什么原因?
由于