code: def _message_generator(self):
          
          self.open()
          auto_complete = self.auto_complete
          self.auto_complete = False
          receiving = True
          message = None
          try:
              while receiving:
                  while receiving and self._received_messages.empty():
                      receiving = self.do_work()
                  while not self._received_messages.empty():
                      message = self._received_messages.get()
                      self._received_messages.task_done()
                      yield message
                      self._complete_message(message, auto_complete)
          finally:
              self._complete_message(message, auto_complete)
              self.auto_complete = auto_complete
              self.close()
docs: Iterate over processed messages in the receive queue.
  
          :rtype: generator[~uamqp.message.Message]