/// Attempts to find a playing MPD host every 5
/// seconds until one is found
Attempts to find a playing MPD host every 5
seconds until one is found
Attempts to find a playing MPD host every 5 seconds until one is found
fn idle(hosts: &[String]) -> MPDClient {
    println!("Entering idle mode");
    loop {
        let conn_wrapper = mpd_conn::try_get_mpd_conn(hosts);
        if let Some(client) = conn_wrapper {
            println!("Exiting idle mode");
            return client;
        }
        thread::sleep(time::Duration::from_secs(IDLE_TIME));
    }
}
fn idle ( hosts : & [ String ] ) -> MPDClient { println ! ( " " ) ; loop { let conn_wrapper = mpd_conn :: try_get_mpd_conn ( hosts ) ; if let Some ( client ) = conn_wrapper { println ! ( " " ) ; return client ; } thread :: sleep ( time :: Duration :: from_secs ( IDLE_TIME ) ) ; } }
Attempts to find a playing MPD host every 5
seconds until one is found
Attempts to find a playing MPD host every 5 seconds until one is found
hosts
&[String]