code: def consume(self, limit=None):
          
          for total_message_count in count():
              if limit and total_message_count >= limit:
                  raise StopIteration
              self.drain_events()
              yield True
docs: Returns an iterator that waits for one message at a time.