#!/usr/bin/env php <?php require_once __DIR__ . '/../bootstrap.php'; use Hodor\Command\Arguments; use Hodor\Config\LoaderFacade as Config; use Hodor\JobQueue\QueueManager; $args = new Arguments(); $config_file = $args->getConfigFile(); $queue_name = $args->getQueueName(); $config = Config::loadFromFile($config_file); $queue_manager = new QueueManager($config); $worker_queue = $queue_manager->getWorkerQueueFactory()->getQueue($queue_name); $worker_queue->runNext($config->getJobQueueConfig()->getJobRunnerFactory());
#!/usr/bin/env php <?php require_once __DIR__ . '/../bootstrap.php'; use Hodor\Command\Arguments; use Hodor\Config\LoaderFacade as Config; use Hodor\JobQueue\QueueManager; $args = new Arguments(); $config_file = $args->getConfigFile(); $config = Config::loadFromFile($config_file); $queue_manager = new QueueManager($config); $superqueue = $queue_manager->getSuperqueue(); if (!$superqueue->requestProcessLock()) { sleep(5); } elseif (!$superqueue->queueJobsFromDatabaseToWorkerQueue()) { sleep(2); }
#!/usr/bin/env php <?php require_once __DIR__ . '/../bootstrap.php'; use Hodor\Command\Arguments; use Hodor\Config\LoaderFacade as Config; use Hodor\JobQueue\QueueManager; $args = new Arguments(); $config_file = $args->getConfigFile(); $queue_name = $args->getQueueName(); $config = Config::loadFromFile($config_file); $queue_manager = new QueueManager($config); $buffer_worker = $queue_manager->getBufferQueueFactory()->getQueue($queue_name); $buffer_worker->processBuffer();
/** * @covers ::__construct * @covers ::getWorkerQueueFactory * @covers ::<private> */ public function testWorkerQueueFactoryIsReused() { $this->assertSame($this->queue_manager->getWorkerQueueFactory(), $this->queue_manager->getWorkerQueueFactory()); }