piwebasync/websockets/client.py
async def update(self, request: APIRequest, rollback: bool = False) -> None:
        """
        Update Channel endpoint
        
        This method does not interrupt `recv`. Any messages already
        in the client buffer will remain there. New messages will
        reflect the updated endpoint accordingly. If `update` fails
        with a *ChannelUpdateError*, the channel will remain in a
        CLOSED state

        **Parameters**

        - **request** (*APIRequest*): The new endpoint to connect to
        - **rollback** (*bool*): The channel will attempt to rollback
        to the previous endpoint

        **Raises**

        - **ChannelRollback**: Unable to establish connection to new endpoint
        but rollback to previous endpoint was successful
        - **ChannelUpdateError**: Unable to establish connection to new endpoint
        - **ChannelClosed**: The channel is closed
        - **ValueError**: Request is invalid
        - **RuntimeError**: if two coroutines call `update` concurrently
        """
        
        if self._waiting_update:
            raise RuntimeError(
                "Cannot call update while another coroutine "
                "is already waiting to update client"
            )

        self._waiting_update = True
        try:
            await self._ensure_open()
            self._verify_request(request)
            old_url = copy.deepcopy(self.url)
            self.url = request.absolute_url
            async with self._update_lock:
                logger.debug("updating channel endpoint")
                self._close_channel_waiter.set_result(None)
                await self._close_channel_task
                try:
                    await self._start()
                    await asyncio.sleep(0)
                except asyncio.TimeoutError as err:
                    if rollback:
                        self.url = old_url
                        try:
                            await self._start()
                            await asyncio.sleep(0)
                            raise ChannelRollback(
                                "Unable to establish new connection. Channel rollback successful."
                            )
                        except asyncio.TimeoutError:
                            pass
                    exc = ChannelUpdateError("Unable to establish new connection")
                    exc.__cause__ = err
                    self._set_channel_exc(exc)
                    self._close_channel_task = None
                    logger.debug("unable to update channel. Channel is closed")
                    raise exc
        finally:
            self._waiting_update = False

        Update Channel endpoint
        
        This method does not interrupt `recv`. Any messages already
        in the client buffer will remain there. New messages will
        reflect the updated endpoint accordingly. If `update` fails
        with a *ChannelUpdateError*, the channel will remain in a
        CLOSED state

        **Parameters**

        - **request** (*APIRequest*): The new endpoint to connect to
        - **rollback** (*bool*): The channel will attempt to rollback
        to the previous endpoint

        **Raises**

        - **ChannelRollback**: Unable to establish connection to new endpoint
        but rollback to previous endpoint was successful
        - **ChannelUpdateError**: Unable to establish connection to new endpoint
        - **ChannelClosed**: The channel is closed
        - **ValueError**: Request is invalid
        - **RuntimeError**: if two coroutines call `update` concurrently
        
Update Channel endpoint
This method does not interrupt `recv`. Any messages already
in the client buffer will remain there. New messages will
reflect the updated endpoint accordingly. If `update` fails
with a *ChannelUpdateError*, the channel will remain in a
CLOSED state

Parameters



Raises


Update Channel endpoint This method does not interrupt ` recv ` . Any messages already in the client buffer will remain there . New messages will reflect the updated endpoint accordingly . If ` update ` fails with a * ChannelUpdateError * the channel will remain in a CLOSED state Parameters Raises
async def update(self, request: APIRequest, rollback: bool = False) -> None:
        if self._waiting_update:
            raise RuntimeError(
                "Cannot call update while another coroutine "
                "is already waiting to update client"
            )
        self._waiting_update = True
        try:
            await self._ensure_open()
            self._verify_request(request)
            old_url = copy.deepcopy(self.url)
            self.url = request.absolute_url
            async with self._update_lock:
                logger.debug("updating channel endpoint")
                self._close_channel_waiter.set_result(None)
                await self._close_channel_task
                try:
                    await self._start()
                    await asyncio.sleep(0)
                except asyncio.TimeoutError as err:
                    if rollback:
                        self.url = old_url
                        try:
                            await self._start()
                            await asyncio.sleep(0)
                            raise ChannelRollback(
                                "Unable to establish new connection. Channel rollback successful."
                            )
                        except asyncio.TimeoutError:
                            pass
                    exc = ChannelUpdateError("Unable to establish new connection")
                    exc.__cause__ = err
                    self._set_channel_exc(exc)
                    self._close_channel_task = None
                    logger.debug("unable to update channel. Channel is closed")
                    raise exc
        finally:
            self._waiting_update = False
async def update ( self , request : APIRequest , rollback : bool = False ) -> None : if self . _waiting_update : raise RuntimeError ( "Cannot call update while another coroutine " "is already waiting to update client" ) self . _waiting_update = True try : await self . _ensure_open ( ) self . _verify_request ( request ) old_url = copy . deepcopy ( self . url ) self . url = request . absolute_url async with self . _update_lock : logger . debug ( "updating channel endpoint" ) self . _close_channel_waiter . set_result ( None ) await self . _close_channel_task try : await self . _start ( ) await asyncio . sleep ( 0 ) except asyncio . TimeoutError as err : if rollback : self . url = old_url try : await self . _start ( ) await asyncio . sleep ( 0 ) raise ChannelRollback ( "Unable to establish new connection. Channel rollback successful." ) except asyncio . TimeoutError : pass exc = ChannelUpdateError ( "Unable to establish new connection" ) exc . __cause__ = err self . _set_channel_exc ( exc ) self . _close_channel_task = None logger . debug ( "unable to update channel. Channel is closed" ) raise exc finally : self . _waiting_update = False
Update Channel endpoint
This method does not interrupt `recv`.
Update Channel endpoint This method does not interrupt ` recv ` .
"""
        Update Channel endpoint
        
        This method does not interrupt `recv`. Any messages already
        in the client buffer will remain there. New messages will
        reflect the updated endpoint accordingly. If `update` fails
        with a *ChannelUpdateError*, the channel will remain in a
        CLOSED state

        **Parameters**

        - **request** (*APIRequest*): The new endpoint to connect to
        - **rollback** (*bool*): The channel will attempt to rollback
        to the previous endpoint

        **Raises**

        - **ChannelRollback**: Unable to establish connection to new endpoint
        but rollback to previous endpoint was successful
        - **ChannelUpdateError**: Unable to establish connection to new endpoint
        - **ChannelClosed**: The channel is closed
        - **ValueError**: Request is invalid
        - **RuntimeError**: if two coroutines call `update` concurrently
        """
self
request
APIRequest
rollback
bool