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