def __iter__(self):
<EOL>self.size.value = <NUM_LIT:0><EOL>self.events.pause.set()<EOL>while True:<EOL><INDENT>self.events.start.set()<EOL>try:<EOL><INDENT>partition, message = self.queue.get(block=True, timeout=<NUM_LIT:1>)<EOL><DEDENT>except queue.Empty:<EOL><INDENT>break<EOL><DEDENT>self.offsets[partition] = message.offset + <NUM_LIT:1><EOL>self.events.start.clear()<EOL>self.count_since_commit += <NUM_LIT:1><EOL>self._auto_commit()<EOL>yield message<EOL><DEDENT>self.events.start.clear()<EOL>
Iterator to consume the messages available on this consumer