def iterqueue(queue, expected):
    """Iterate all value from the queue until the ``expected`` number of EXIT elements is
    received"""
    while expected > 0:
        for item in iter(queue.get, EXIT):
            yield item
        expected -= 1
def iterqueue ( queue , expected ) : while expected > 0 : for item in iter ( queue . get , EXIT ) : yield item expected -= 1
Iterate all value from the queue until the ``expected`` number of EXIT elements is
    received