<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _message_generator(self):
 """Iterate over processed messages in the receive queue. :rtype: generator[~uamqp.message.Message] """

        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()