Iterate all value from the queue until the ``expected`` number of EXIT elements is
    received

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