Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gevent.queue
- queue = gevent.queue.Queue()
- for i in range(5):
- queue.put(i)
- while True:
- print queue.get()
- -------------------------
- Output:
- 0
- 1
- 2
- 3
- 4
- Traceback (most recent call last):
- File "E:\Development\PythonSrc\stack_overflow_answers\gev4.py", line 8, in <module>
- print queue.get()
- File "E:\Development\Python27\lib\site-packages\gevent\queue.py", line 189, in get
- result = waiter.get()
- File "E:\Development\Python27\lib\site-packages\gevent\hub.py", line 579, in get
- return self.hub.switch()
- File "E:\Development\Python27\lib\site-packages\gevent\hub.py", line 338, in switch
- return greenlet.switch(self)
- gevent.hub.LoopExit: This operation would block forever
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement