pub async fn listen(&mut self) -> Result {
        self.authenticate().await?;

        info!(target: "Client", "Client authenticated successfully. Starting listening for events");

        loop {
            if let Err(err) = self.ws_client.check_heartbeat().await {
                warn!(target: "Client", "Err heartbeating: {}", err);
            }

            select! {
                event = self.ws_client.accept().fuse() => {
                    if let Some(event) = event {
                        self.handle_event(event);
                    } else {
                        info!(target: "Client", "Connection closed");
                        return Ok(());
                    }
                },
                action = self.action_rx.recv().fuse() => self.handle_action(action.unwrap()).await,
            }
        }
    }
/// Start listening for server events.
Start listening for server events.
Start listening for server events .
pub async fn listen(&mut self) -> Result {
        self.authenticate().await?;
        info!(target: "Client", "Client authenticated successfully. Starting listening for events");
        loop {
            if let Err(err) = self.ws_client.check_heartbeat().await {
                warn!(target: "Client", "Err heartbeating: {}", err);
            }
            select! {
                event = self.ws_client.accept().fuse() => {
                    if let Some(event) = event {
                        self.handle_event(event);
                    } else {
                        info!(target: "Client", "Connection closed");
                        return Ok(());
                    }
                },
                action = self.action_rx.recv().fuse() => self.handle_action(action.unwrap()).await,
            }
        }
    }
pub async fn listen ( & mut self ) -> Result { self . authenticate ( ) . await ? ; info ! ( target " " " " ) ; loop { if let Err ( err ) = self . ws_client . check_heartbeat ( ) . await { warn ! ( target " " " " err ) ; } select ! { event self ws_client accept ( ) fuse ( ) { if let Some ( event ) event { self handle_event ( event ) } else { info ( target " " " " ) return Ok ( ( ) ) } } action self action_rx recv ( ) fuse ( ) self handle_action ( action unwrap ( ) ) await } } }
Start listening for server events.
Start listening for server events .
&mut self
&mut self