pub async fn run(&mut self) {
        if !matches!(self.conn_state, ConnectionState::Authenticated) {
            error!("Not connected, trying reconnect");
            if let Err(err) = self.connect().await {
                error!("Problem while connecting: {}", err);
                self.disconnect("Problem while connecting").await;
                return;
            }
        }

        if !self.is_server_alive().await {
            info!("Blynk is offline for some reson :(");
            self.disconnect("Blynk server is offline").await;
            return;
        }

        // otherwise wait for response
        self.read_response()
            .or(async {
                Timer::after(Duration::from_millis(5)).await;
            })
            .await;
    }
/// Performs event loop run that is reposnible for:
/// - checking the connection state
/// - reconnecting if connection failed
/// - reading any pending responses from blynk servers
/// - executing events hooks if those are provided
Performs event loop run that is reposnible for:
checking the connection state
reconnecting if connection failed
reading any pending responses from blynk servers
executing events hooks if those are provided
Performs event loop run that is reposnible for : checking the connection state reconnecting if connection failed reading any pending responses from blynk servers executing events hooks if those are provided
pub async fn run(&mut self) {
        if !matches!(self.conn_state, ConnectionState::Authenticated) {
            error!("Not connected, trying reconnect");
            if let Err(err) = self.connect().await {
                error!("Problem while connecting: {}", err);
                self.disconnect("Problem while connecting").await;
                return;
            }
        }
        if !self.is_server_alive().await {
            info!("Blynk is offline for some reson :(");
            self.disconnect("Blynk server is offline").await;
            return;
        }
        // otherwise wait for response
        self.read_response()
            .or(async {
                Timer::after(Duration::from_millis(5)).await;
            })
            .await;
    }
pub async fn run ( & mut self ) { if ! matches ! ( self conn_state ConnectionState Authenticated ) { error ! ( " " ) ; if let Err ( err ) = self . connect ( ) . await { error ! ( " " err ) ; self . disconnect ( " " ) . await ; return ; } } if ! self . is_server_alive ( ) . await { info ! ( " " ) ; self . disconnect ( " " ) . await ; return ; } // otherwise wait for response self . read_response ( ) . or ( async { Timer :: after ( Duration :: from_millis ( 5 ) ) . await ; } ) . await ; }
Performs event loop run that is reposnible for:
 checking the connection state
 reconnecting if connection failed
 reading any pending responses from blynk servers
 executing events hooks if those are provided
Performs event loop run that is reposnible for : checking the connection state reconnecting if connection failed reading any pending responses from blynk servers executing events hooks if those are provided
&mut self
&mut self