function clearRefBag(int $timeout) {
        $time = \time() - $timeout;
        
        foreach($this->refBag as $id => $timestamp) {
            if($timestamp <= $time) {
                unset($this->refBag[$id]);
            }
        }
        
        if(\count($this->refBag) === 0 && $this->stack->count() === 0) {
            $this->bag->lastEmptyStack = \time();
            $this->bag->currentlyBusy = false;
            
            $msg = new \CharlotteDunois\Phoebe\Message('internal-worker-stack-free', null);
            $this->sendMessageToPool($msg);
        }
    }
function clearRefBag(int $timeout) {
        $time = \time() - $timeout;
        
        foreach($this->refBag as $id => $timestamp) {
            if($timestamp <= $time) {
                unset($this->refBag[$id]);
            }
        }
        
        if(\count($this->refBag) === 0 && $this->stack->count() === 0) {
            $this->bag->lastEmptyStack = \time();
            $this->bag->currentlyBusy = false;
            
            $msg = new \CharlotteDunois\Phoebe\Message('internal-worker-stack-free', null);
            $this->sendMessageToPool($msg);
        }
    }
function clearRefBag ( int $ timeout ) { $ time = \ time ( ) - $ timeout ; foreach ( $ this -> refBag as $ id => $ timestamp ) { if ( $ timestamp <= $ time ) { unset ( $ this -> refBag [ $ id ] ) ; } } if ( \ count ( $ this -> refBag ) === 0 && $ this -> stack -> count ( ) === 0 ) { $ this -> bag -> lastEmptyStack = \ time ( ) ; $ this -> bag -> currentlyBusy = false ; $ msg = new \ CharlotteDunois \ Phoebe \ Message ( 'internal-worker-stack-free' , null ) ; $ this -> sendMessageToPool ( $ msg ) ; } }
Clears too old references.
@param int  $timeout
@return void
@internal
Clears too old references .