<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def send_all_messages_async(self, close_on_done=True):
 """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] """

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