'Iterator to consume the messages available on this consumer'

def __iter__(self):

    self.size.value = 0
    self.events.pause.set()
    while True:
        self.events.start.set()
        try:
            (partition, message) = self.queue.get(block=True, timeout=1)
        except queue.Empty:
            break
        self.offsets[partition] = (message.offset + 1)
        self.events.start.clear()
        self.count_since_commit += 1
        self._auto_commit()
        (yield message)
    self.events.start.clear()
