src/PoolClientTrait.php
protected function changeQueueCount($queueCounter)
    {
        if ($queueCounter < 0) {
            $queueCounter = 0;
        }
        $this->_poolClientQueueCounter = $queueCounter;
        //Automatically change client state to `ClientInterface::CLIENT_POOL_STATE_READY` on empty queue
        if ($this->_poolClientQueueCounter === 0 && $this->_poolClientState === PoolClientInterface::CLIENT_POOL_STATE_BUSY) {
            $this->changeState(PoolClientInterface::CLIENT_POOL_STATE_READY);
        } elseif ($this->_poolClientQueueCounter > 0 && $this->_poolClientState === PoolClientInterface::CLIENT_POOL_STATE_READY) {
            $this->changeState(PoolClientInterface::CLIENT_POOL_STATE_BUSY);
        }
        $this->emit(PoolClientInterface::CLIENT_POOL_EVENT_CHANGE_QUEUE, [$queueCounter]);
    }
protected function changeQueueCount($queueCounter)
    {
        if ($queueCounter < 0) {
            $queueCounter = 0;
        }
        $this->_poolClientQueueCounter = $queueCounter;
        //Automatically change client state to `ClientInterface::CLIENT_POOL_STATE_READY` on empty queue
        if ($this->_poolClientQueueCounter === 0 && $this->_poolClientState === PoolClientInterface::CLIENT_POOL_STATE_BUSY) {
            $this->changeState(PoolClientInterface::CLIENT_POOL_STATE_READY);
        } elseif ($this->_poolClientQueueCounter > 0 && $this->_poolClientState === PoolClientInterface::CLIENT_POOL_STATE_READY) {
            $this->changeState(PoolClientInterface::CLIENT_POOL_STATE_BUSY);
        }
        $this->emit(PoolClientInterface::CLIENT_POOL_EVENT_CHANGE_QUEUE, [$queueCounter]);
    }
protected function changeQueueCount ( $ queueCounter ) { if ( $ queueCounter < 0 ) { $ queueCounter = 0 ; } $ this -> _poolClientQueueCounter = $ queueCounter ; //Automatically change client state to `ClientInterface::CLIENT_POOL_STATE_READY` on empty queue if ( $ this -> _poolClientQueueCounter === 0 && $ this -> _poolClientState === PoolClientInterface :: CLIENT_POOL_STATE_BUSY ) { $ this -> changeState ( PoolClientInterface :: CLIENT_POOL_STATE_READY ) ; } elseif ( $ this -> _poolClientQueueCounter > 0 && $ this -> _poolClientState === PoolClientInterface :: CLIENT_POOL_STATE_READY ) { $ this -> changeState ( PoolClientInterface :: CLIENT_POOL_STATE_BUSY ) ; } $ this -> emit ( PoolClientInterface :: CLIENT_POOL_EVENT_CHANGE_QUEUE , [ $ queueCounter ] ) ; }
Change client queue counter helper
@param int $queueCounter
Change client queue counter helper