async fn cool_down(&self) {
        if atomic_load!(self.policy_data.cooling_down, Ordering::SeqCst) {
            // prevents a few racy threads making it in here and doubling the wait time erroneously
            return;
        }

        atomic_store!(self.policy_data.cooling_down, true, Ordering::SeqCst);

        sleep(Duration::from_millis(self.policy_data.wait_time)).await;

        atomic_store!(self.policy_data.cooling_down, false, Ordering::SeqCst);
    }
/// sleep and set a flag that can be checked by other threads
sleep and set a flag that can be checked by other threads
sleep and set a flag that can be checked by other threads
async fn cool_down(&self) {
        if atomic_load!(self.policy_data.cooling_down, Ordering::SeqCst) {
            // prevents a few racy threads making it in here and doubling the wait time erroneously
            return;
        }
        atomic_store!(self.policy_data.cooling_down, true, Ordering::SeqCst);
        sleep(Duration::from_millis(self.policy_data.wait_time)).await;
        atomic_store!(self.policy_data.cooling_down, false, Ordering::SeqCst);
    }
async fn cool_down ( & self ) { if atomic_load ! ( self policy_data cooling_down Ordering SeqCst ) { // prevents a few racy threads making it in here and doubling the wait time erroneously return ; } atomic_store ! ( self policy_data cooling_down true Ordering SeqCst ) ; sleep ( Duration :: from_millis ( self . policy_data . wait_time ) ) . await ; atomic_store ! ( self policy_data cooling_down false Ordering SeqCst ) ; }
sleep and set a flag that can be checked by other threads
sleep and set a flag that can be checked by other threads
&self