public function run(JobInterface $job, $maxProcesses) { $collection = new JobCollection(); $collection->addJob($job); $worker = $this->factory->getWorker($collection, $maxProcesses); $worker->setMode(Worker::MODE_SERIAL); $worker->setStopIfNoJob(); $worker->work(); }