
Jan. 20, 2010
11:48 p.m.
On Jan 20, 2010, at 12:28 PM, cool-RR wrote:
Thanks for the code Raymond. However, what I use is actually simpler:
def iterate(queue, block=False): '''Iterate over the items in the queue.''' while True: try: yield queue.get(block=block) except Queue.Empty: raise StopIteration
Then it sounds like the existing API is more than adequate for your needs. Dump the above fragment in your utils module and be done with it. Raymond