I've got two threads in my application. One that puts values in a
item = request_queue.get() # this call blocks until an item is available
The answer it turns out is quite simple. Pick a value that would be invalid for the code that processes the
None is ideal for that) and push that into the
Queue. Then have the
Queue processing thread quit when it gets the value:
while True: item = request_queue.get() if item is None: break # process the Queue as per normal...