code: async def send_all_messages_async(self, close_on_done=True):
          
          await self.open_async()
          try:
              async with self._pending_messages_lock:
                  messages = self._pending_messages[:]
              await self.wait_async()
              results = [m.state for m in messages]
              return results
          finally:
              if close_on_done:
                  await self.close_async()
docs: Send all pending messages in the queue asynchronously.
          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]