// Called on request completion.
// If the request was successful, the token is returned to the
// free pool so that more requests can be issued in its place.
// If the request failed, the token is dropped without returning
// to the pool. This dynamically adjusts the pool size/max
// outstanding requests.
Called on request completion.
If the request was successful, the token is returned to the
free pool so that more requests can be issued in its place.
If the request failed, the token is dropped without returning
to the pool. This dynamically adjusts the pool size/max
outstanding requests.
Called on request completion . If the request was successful the token is returned to the free pool so that more requests can be issued in its place . If the request failed the token is dropped without returning to the pool . This dynamically adjusts the pool size / max outstanding requests .
fn free_permit(&self, permit: OwnedSemaphorePermit, request_success: bool) {
        if !request_success {
            // TODO: keep a min threshold, look at the specific
            // HTTP status code
            permit.forget();
            self.errors.fetch_add(1, Ordering::SeqCst);
        } else {
            self.success.fetch_add(1, Ordering::SeqCst);
        }
    }
fn free_permit ( & self , permit : OwnedSemaphorePermit , request_success : bool ) { if ! request_success { // TODO: keep a min threshold, look at the specific // HTTP status code permit . forget ( ) ; self . errors . fetch_add ( 1 , Ordering :: SeqCst ) ; } else { self . success . fetch_add ( 1 , Ordering :: SeqCst ) ; } }
Called on request completion.
Called on request completion .
&self
permit
OwnedSemaphorePermit
request_success
bool