fn should_enforce_policy(&self) -> Option<PolicyTrigger> {
        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 None;
        }

        let requests = atomic_load!(self.handles.stats.data.requests);

        if requests < max(self.handles.config.threads, 50) {
            // check whether at least a full round of threads has made requests or 50 (default # of
            // threads), whichever is higher
            return None;
        }

        if self.too_many_errors() {
            return Some(PolicyTrigger::Errors);
        }

        if self.too_many_status_errors(PolicyTrigger::Status403) {
            return Some(PolicyTrigger::Status403);
        }

        if self.too_many_status_errors(PolicyTrigger::Status429) {
            return Some(PolicyTrigger::Status429);
        }

        None
    }
/// determine whether or not a policy needs to be enforced
///
/// criteria:
/// - number of threads (50 default) for general errors (timeouts etc)
/// - 90% of requests are 403
/// - 30% of requests are 429
determine whether or not a policy needs to be enforced
criteria:
number of threads (50 default) for general errors (timeouts etc)
90% of requests are 403
30% of requests are 429
determine whether or not a policy needs to be enforced criteria : number of threads ( 50 default ) for general errors ( timeouts etc ) 90% of requests are 403 30% of requests are 429
fn should_enforce_policy(&self) -> Option<PolicyTrigger> {
        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 None;
        }
        let requests = atomic_load!(self.handles.stats.data.requests);
        if requests < max(self.handles.config.threads, 50) {
            // check whether at least a full round of threads has made requests or 50 (default # of
            // threads), whichever is higher
            return None;
        }
        if self.too_many_errors() {
            return Some(PolicyTrigger::Errors);
        }
        if self.too_many_status_errors(PolicyTrigger::Status403) {
            return Some(PolicyTrigger::Status403);
        }
        if self.too_many_status_errors(PolicyTrigger::Status429) {
            return Some(PolicyTrigger::Status429);
        }
        None
    }
fn should_enforce_policy ( & self ) -> Option < PolicyTrigger > { 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 None ; } let requests = atomic_load ! ( self handles stats data requests ) ; if requests < max ( self . handles . config . threads , 50 ) { // check whether at least a full round of threads has made requests or 50 (default # of // threads), whichever is higher return None ; } if self . too_many_errors ( ) { return Some ( PolicyTrigger :: Errors ) ; } if self . too_many_status_errors ( PolicyTrigger :: Status403 ) { return Some ( PolicyTrigger :: Status403 ) ; } if self . too_many_status_errors ( PolicyTrigger :: Status429 ) { return Some ( PolicyTrigger :: Status429 ) ; } None }
determine whether or not a policy needs to be enforced
criteria:
 number of threads (50 default) for general errors (timeouts etc)
 90% of requests are 403
 30% of requests are 429
determine whether or not a policy needs to be enforced criteria : number of threads ( 50 default ) for general errors ( timeouts etc ) 90% of requests are 403 30% of requests are 429
&self