Advertisement
Guest User

gevent.hub.LoopExit

a guest
Feb 8th, 2012
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import gevent.queue
  2.  
  3. queue = gevent.queue.Queue()
  4. for i in range(5):
  5.     queue.put(i)
  6.  
  7. while True:
  8.     print queue.get()
  9.  
  10. -------------------------
  11. Output:
  12. 0
  13. 1
  14. 2
  15. 3
  16. 4
  17. Traceback (most recent call last):
  18.   File "E:\Development\PythonSrc\stack_overflow_answers\gev4.py", line 8, in <module>
  19.     print queue.get()
  20.   File "E:\Development\Python27\lib\site-packages\gevent\queue.py", line 189, in get
  21.     result = waiter.get()
  22.   File "E:\Development\Python27\lib\site-packages\gevent\hub.py", line 579, in get
  23.     return self.hub.switch()
  24.   File "E:\Development\Python27\lib\site-packages\gevent\hub.py", line 338, in switch
  25.     return greenlet.switch(self)
  26. gevent.hub.LoopExit: This operation would block forever
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement