piwebasync/websockets/client.py
async def _run(self) -> None:
        """
        Run websocket protocol and data transfer in a loop

        This task will continuously attempt to establish a websocket
        connection to the channel endpoint. Once a connection is established
        it will begin a data transfer task to receive messages, process them,
        and place them in a buffer. If the websocket connection is closed via
        a protocol failure, network failure, or message processing failure; the
        channel may attempt to reconnect otherwise it will break out of the loop.
        The completion of the this task by an exception will trigger the closing
        of the client instance. This task is designed to be cancelled by
        `close_channel` during a normal close procedure
        """
        try:
            async for protocol in websockets.connect(self.url, **self._ws_connect_params):
                logger.debug("channel opened")
                self._channel_open_event.set()
                try:
                    await self._transfer_data(protocol)
                # websocket connection was lost
                except ConnectionClosedError as err:
                    logger.debug("protocol or network error ocurred", exc_info=True)
                    if self._reconnect:
                        logger.debug("attempting to reconnect")
                        continue
                    self._set_channel_exc(err)
                    break
                # drop when websockets no longer supports python < 3.8
                except asyncio.CancelledError:
                    raise
                # an exception was raised processing message
                except Exception as err:
                    logger.debug("unhandled exception in _transfer_data", exc_info=True)
                    if self._reconnect:
                        logger.debug("attempting to reconnect")
                        continue
                    await protocol.close()
                    self._set_channel_exc(err)
                    break
                finally:
                    self._channel_open_event.clear()
        except asyncio.CancelledError:
            pass

        Run websocket protocol and data transfer in a loop

        This task will continuously attempt to establish a websocket
        connection to the channel endpoint. Once a connection is established
        it will begin a data transfer task to receive messages, process them,
        and place them in a buffer. If the websocket connection is closed via
        a protocol failure, network failure, or message processing failure; the
        channel may attempt to reconnect otherwise it will break out of the loop.
        The completion of the this task by an exception will trigger the closing
        of the client instance. This task is designed to be cancelled by
        `close_channel` during a normal close procedure
        
Run websocket protocol and data transfer in a loop
This task will continuously attempt to establish a websocket
connection to the channel endpoint. Once a connection is established
it will begin a data transfer task to receive messages, process them,
and place them in a buffer. If the websocket connection is closed via
a protocol failure, network failure, or message processing failure; the
channel may attempt to reconnect otherwise it will break out of the loop.
The completion of the this task by an exception will trigger the closing
of the client instance. This task is designed to be cancelled by
`close_channel` during a normal close procedure
Run websocket protocol and data transfer in a loop This task will continuously attempt to establish a websocket connection to the channel endpoint . Once a connection is established it will begin a data transfer task to receive messages process them and place them in a buffer . If the websocket connection is closed via a protocol failure network failure or message processing failure ; the channel may attempt to reconnect otherwise it will break out of the loop . The completion of the this task by an exception will trigger the closing of the client instance . This task is designed to be cancelled by ` close_channel ` during a normal close procedure
async def _run(self) -> None:
        try:
            async for protocol in websockets.connect(self.url, **self._ws_connect_params):
                logger.debug("channel opened")
                self._channel_open_event.set()
                try:
                    await self._transfer_data(protocol)
                except ConnectionClosedError as err:
                    logger.debug("protocol or network error ocurred", exc_info=True)
                    if self._reconnect:
                        logger.debug("attempting to reconnect")
                        continue
                    self._set_channel_exc(err)
                    break
                except asyncio.CancelledError:
                    raise
                except Exception as err:
                    logger.debug("unhandled exception in _transfer_data", exc_info=True)
                    if self._reconnect:
                        logger.debug("attempting to reconnect")
                        continue
                    await protocol.close()
                    self._set_channel_exc(err)
                    break
                finally:
                    self._channel_open_event.clear()
        except asyncio.CancelledError:
            pass
async def _run ( self ) -> None : try : async for protocol in websockets . connect ( self . url , ** self . _ws_connect_params ) : logger . debug ( "channel opened" ) self . _channel_open_event . set ( ) try : await self . _transfer_data ( protocol ) except ConnectionClosedError as err : logger . debug ( "protocol or network error ocurred" , exc_info = True ) if self . _reconnect : logger . debug ( "attempting to reconnect" ) continue self . _set_channel_exc ( err ) break except asyncio . CancelledError : raise except Exception as err : logger . debug ( "unhandled exception in _transfer_data" , exc_info = True ) if self . _reconnect : logger . debug ( "attempting to reconnect" ) continue await protocol . close ( ) self . _set_channel_exc ( err ) break finally : self . _channel_open_event . clear ( ) except asyncio . CancelledError : pass
Run websocket protocol and data transfer in a loop
This task will continuously attempt to establish a websocket
connection to the channel endpoint.
Run websocket protocol and data transfer in a loop This task will continuously attempt to establish a websocket connection to the channel endpoint .
"""
        Run websocket protocol and data transfer in a loop

        This task will continuously attempt to establish a websocket
        connection to the channel endpoint. Once a connection is established
        it will begin a data transfer task to receive messages, process them,
        and place them in a buffer. If the websocket connection is closed via
        a protocol failure, network failure, or message processing failure; the
        channel may attempt to reconnect otherwise it will break out of the loop.
        The completion of the this task by an exception will trigger the closing
        of the client instance. This task is designed to be cancelled by
        `close_channel` during a normal close procedure
        """ # websocket connection was lost # drop when websockets no longer supports python < 3.8 # an exception was raised processing message
self