pub fn block_for_beats(&self, count: usize, timeout: Duration) -> Result<()> {
        let mut running_count = 0;
        let start_time = SystemTime::now();
        loop {
            if SystemTime::now().duration_since(start_time)? >= timeout { return Err(TE::NothingNewToReport)};

            if let Ok(roster) = self.get_roster_actives() {
                if roster.len() >= running_count { running_count = roster.len()};
            }
            if running_count >= count { return Ok(()) };

            thread::sleep(Duration::from_millis(250));            

        }
    }
// Blocking the thread that the DJ is in until beat counts are up to a certain
// amount or a certain wait time has been reached
Blocking the thread that the DJ is in until beat counts are up to a certain
amount or a certain wait time has been reached
Blocking the thread that the DJ is in until beat counts are up to a certain amount or a certain wait time has been reached
pub fn block_for_beats(&self, count: usize, timeout: Duration) -> Result<()> {
        let mut running_count = 0;
        let start_time = SystemTime::now();
        loop {
            if SystemTime::now().duration_since(start_time)? >= timeout { return Err(TE::NothingNewToReport)};
            if let Ok(roster) = self.get_roster_actives() {
                if roster.len() >= running_count { running_count = roster.len()};
            }
            if running_count >= count { return Ok(()) };
            thread::sleep(Duration::from_millis(250));            
        }
    }
pub fn block_for_beats ( & self , count : usize , timeout : Duration ) -> Result < ( ) > { let mut running_count = 0 ; let start_time = SystemTime :: now ( ) ; loop { if SystemTime :: now ( ) . duration_since ( start_time ) ? >= timeout { return Err ( TE :: NothingNewToReport ) } ; if let Ok ( roster ) = self . get_roster_actives ( ) { if roster . len ( ) >= running_count { running_count = roster . len ( ) } ; } if running_count >= count { return Ok ( ( ) ) } ; thread :: sleep ( Duration :: from_millis ( 250 ) ) ; } }
Blocking the thread that the DJ is in until beat counts are up to a certain
amount or a certain wait time has been reached
Blocking the thread that the DJ is in until beat counts are up to a certain amount or a certain wait time has been reached
&self
count
usize
timeout
Duration
&self
count
usize
timeout
Duration