piwebasync/websockets/client.py
async def _close_channel(self) -> None:
        """
        Close the channel

        This task is started after the first connection to the
        channel endpoint is established. It ensures `run channel task`
        finishes
        """

        close_channel_waiter = self._loop.create_future()
        self._close_channel_waiter = close_channel_waiter
        try:
            await asyncio.wait(
                [close_channel_waiter, self._run_channel_task],
                return_when=asyncio.FIRST_COMPLETED
            )
        except asyncio.CancelledError:
            pass
        finally:
            self._close_channel_waiter = None
        # if wait was cancelled or close_channel_waiter finished
        # first, cancel _run_channel_task
        if not self._run_channel_task.done():
            self._run_channel_task.cancel()
        await asyncio.shield(self._run_channel_task)

        Close the channel

        This task is started after the first connection to the
        channel endpoint is established. It ensures `run channel task`
        finishes
        
Close the channel
This task is started after the first connection to the
channel endpoint is established. It ensures `run channel task`
finishes
Close the channel This task is started after the first connection to the channel endpoint is established . It ensures ` run channel task ` finishes
async def _close_channel(self) -> None:
        close_channel_waiter = self._loop.create_future()
        self._close_channel_waiter = close_channel_waiter
        try:
            await asyncio.wait(
                [close_channel_waiter, self._run_channel_task],
                return_when=asyncio.FIRST_COMPLETED
            )
        except asyncio.CancelledError:
            pass
        finally:
            self._close_channel_waiter = None
        if not self._run_channel_task.done():
            self._run_channel_task.cancel()
        await asyncio.shield(self._run_channel_task)
async def _close_channel ( self ) -> None : close_channel_waiter = self . _loop . create_future ( ) self . _close_channel_waiter = close_channel_waiter try : await asyncio . wait ( [ close_channel_waiter , self . _run_channel_task ] , return_when = asyncio . FIRST_COMPLETED ) except asyncio . CancelledError : pass finally : self . _close_channel_waiter = None if not self . _run_channel_task . done ( ) : self . _run_channel_task . cancel ( ) await asyncio . shield ( self . _run_channel_task )
Close the channel
This task is started after the first connection to the
channel endpoint is established.
Close the channel This task is started after the first connection to the channel endpoint is established .
"""
        Close the channel

        This task is started after the first connection to the
        channel endpoint is established. It ensures `run channel task`
        finishes
        """ # if wait was cancelled or close_channel_waiter finished # first, cancel _run_channel_task
self