public function run($jobs)
        {
            $lenTab = count($jobs);
            for ($i = 0 ; $i < $lenTab ; $i++) {
                $jobID = rand(0, 100);
                while (count($this->currentJobs) >= $this->maxProcesses) {
                    sleep($this->sleepTime);
                }

                $launched = $this->launchJobProcess($jobID, "Jobs", $jobs[$i]);
            }

            while (count($this->currentJobs)) {
                sleep($this->sleepTime);
            }
        }
public function run($jobs)
        {
            $lenTab = count($jobs);
            for ($i = 0 ; $i < $lenTab ; $i++) {
                $jobID = rand(0, 100);
                while (count($this->currentJobs) >= $this->maxProcesses) {
                    sleep($this->sleepTime);
                }

                $launched = $this->launchJobProcess($jobID, "Jobs", $jobs[$i]);
            }

            while (count($this->currentJobs)) {
                sleep($this->sleepTime);
            }
        }
public function run ( $ jobs ) { $ lenTab = count ( $ jobs ) ; for ( $ i = 0 ; $ i < $ lenTab ; $ i ++ ) { $ jobID = rand ( 0 , 100 ) ; while ( count ( $ this -> currentJobs ) >= $ this -> maxProcesses ) { sleep ( $ this -> sleepTime ) ; } $ launched = $ this -> launchJobProcess ( $ jobID , "Jobs" , $ jobs [ $ i ] ) ; } while ( count ( $ this -> currentJobs ) ) { sleep ( $ this -> sleepTime ) ; } }
Run the Daemon
Run the Daemon