code: def send_all_messages(self, close_on_done=True):
          
          self.open()
          running = True
          try:
              messages = self._pending_messages[:]
              running = self.wait()
              results = [m.state for m in messages]
              return results
          finally:
              if close_on_done or not running:
                  self.close()
docs: Send all pending messages in the queue. This will return a list
          of the send result of all the pending messages so it can be
          determined if any messages failed to send.
          This function will open the client if it is not already open.
  
          :param close_on_done: Close the client once the messages are sent.
           Default is `True`.
          :type close_on_done: bool
          :rtype: list[~uamqp.constants.MessageState]