public function tick()
    {
        $this->cleanup();

        if ((count($this->threads) < $this->queueSize) && count($this->jobs)) {
            $this->threads[] = $szal = new Thread($this->callable, $this->message_length);
            $szal->start(array_shift($this->jobs));
        }

        usleep(ThreadQueue::TICK_DELAY);
        return $this->queueSize();
    }
public function tick()
    {
        $this->cleanup();

        if ((count($this->threads) < $this->queueSize) && count($this->jobs)) {
            $this->threads[] = $szal = new Thread($this->callable, $this->message_length);
            $szal->start(array_shift($this->jobs));
        }

        usleep(ThreadQueue::TICK_DELAY);
        return $this->queueSize();
    }
public function tick ( ) { $ this -> cleanup ( ) ; if ( ( count ( $ this -> threads ) < $ this -> queueSize ) && count ( $ this -> jobs ) ) { $ this -> threads [ ] = $ szal = new Thread ( $ this -> callable , $ this -> message_length ) ; $ szal -> start ( array_shift ( $ this -> jobs ) ) ; } usleep ( ThreadQueue :: TICK_DELAY ) ; return $ this -> queueSize ( ) ; }
Starts new threads if needed

@return int    queue size
Starts new threads if needed