protected function execute(InputInterface $input, OutputInterface $output) { $queue = $this->getConfig('queue'); $blocking = filter_var($this->getConfig('blocking'), FILTER_VALIDATE_BOOLEAN); // Create worker instance $worker = new Resque\Worker($queue, $blocking); $worker->setLogger($this->logger); if ($pidFile = $this->getConfig('pid')) { $worker->setPidFile($pidFile); } if ($interval = $this->getConfig('interval')) { $worker->setInterval($interval); } if ($timeout = $this->getConfig('timeout')) { $worker->setTimeout($timeout); } // The memory limit is the amount of memory we will allow the script to occupy // before killing it and letting a process manager restart it for us, which // is to protect us against any memory leaks that will be in the scripts. if ($memory = $this->getConfig('memory')) { $worker->setMemoryLimit($memory); } $worker->work(); }