Beispiel #1
0
#!/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());
Beispiel #2
0
#!/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);
}
Beispiel #3
0
#!/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();
Beispiel #4
0
 /**
  * @covers ::__construct
  * @covers ::getWorkerQueueFactory
  * @covers ::<private>
  */
 public function testWorkerQueueFactoryIsReused()
 {
     $this->assertSame($this->queue_manager->getWorkerQueueFactory(), $this->queue_manager->getWorkerQueueFactory());
 }