0
Gevent無法正常工作。我想下面會永遠阻止,但我得到下面的錯誤。gevent隊列如何阻塞和empy隊列,直到項目在隊列中?
from gevent import monkey; monkey.patch_all()
import gevent
import gevent.queue
queue = gevent.queue.Queue()
queue.get(block=True, timeout=None)
File "/home/ubuntu/workspace/zenserver/upload_pusher.py", line 53, in proccess_file
filepath = queue.get(block=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/gevent-1.0b2-py2.7-linux-x86_64.egg/gevent/queue.py", line 189, in get
result = waiter.get()
File "/usr/local/lib/python2.7/dist-packages/gevent-1.0b2-py2.7-linux-x86_64.egg/gevent/hub.py", line 616, in get
return self.hub.switch()
File "/usr/local/lib/python2.7/dist-packages/gevent-1.0b2-py2.7-linux-x86_64.egg/gevent/hub.py", line 373, in switch
return greenlet.switch(self)
gevent.hub.LoopExit: This operation would block forever