pub async fn react_loop(
        &mut self,
        event_interval: Duration,
    ) -> Result<(), Error> {
        let mut interval = time::interval(event_interval);

        while self.shared.is_connected() {
            match self.poll().await? {
                Some(crossterm) => self.react(crossterm).await?,
                None => tokio::select! {
                    _ = interval.tick() => (),
                    _ = self.shared.events().subscribe() => (),
                },
            }
        }

        Ok(())
    }
/// Performs a "react loop", i.e. keeps polling events, reacting to the
/// events, and sending them to the event listener.
Performs a "react loop", i.e. keeps polling events, reacting to the
events, and sending them to the event listener.
Performs a " react loop " i . e . keeps polling events reacting to the events and sending them to the event listener .
pub async fn react_loop(
        &mut self,
        event_interval: Duration,
    ) -> Result<(), Error> {
        let mut interval = time::interval(event_interval);
        while self.shared.is_connected() {
            match self.poll().await? {
                Some(crossterm) => self.react(crossterm).await?,
                None => tokio::select! {
                    _ = interval.tick() => (),
                    _ = self.shared.events().subscribe() => (),
                },
            }
        }
        Ok(())
    }
pub async fn react_loop ( & mut self , event_interval : Duration , ) -> Result < ( ) , Error > { let mut interval = time :: interval ( event_interval ) ; while self . shared . is_connected ( ) { match self . poll ( ) . await ? { Some ( crossterm ) => self . react ( crossterm ) . await ? , None => tokio :: select ! { interval tick ( ) ( ) self shared events ( ) subscribe ( ) ( ) } , } } Ok ( ( ) ) }
Performs a "react loop", i.e.
Performs a " react loop " i . e .
&mut self
event_interval
Duration
&mut self
event_interval
Duration