コード例 #1
0
ファイル: Generic.php プロジェクト: coderkungfu/ckfqueue
 public function __construct()
 {
     parent::__construct();
     $config_class = \PHPQueue\Base::$config_class;
     $config = $config_class::getConfig($this->queue_type);
     $this->dataSource = \PHPQueue\Base::backendFactory($config['backend'], $config);
     $this->resultLog = \PHPQueue\Logger::createLogger('MainLogger', \PHPQueue\Logger::INFO, sprintf('%s/QueueLog-%s-%s.log', $config_class::getLogRoot(), $this->queue_type, date('Ymd')));
 }
コード例 #2
0
ファイル: Runner.php プロジェクト: postelin/php-queue
 protected function processWorker($worker_name, $new_job)
 {
     $this->logger->addInfo(sprintf("Running new job (%s) with worker: %s", $new_job->job_id, $worker_name));
     $worker = Base::getWorker($worker_name);
     Base::workJob($worker, $new_job);
     $this->logger->addInfo(sprintf('Worker is done. Updating job (%s). Result:', $new_job->job_id), $worker->result_data);
     return $worker->result_data;
 }
コード例 #3
0
ファイル: Runner.php プロジェクト: nanderoo/php-queue
 public function setup()
 {
     if (empty($this->log_path)) {
         $baseFolder = dirname(dirname(__DIR__));
         $this->log_path = sprintf('%s/demo/runners/logs/', $baseFolder);
     }
     $logFileName = sprintf('%s-%s.log', $this->queue_name, date('Ymd'));
     $this->logger = \PHPQueue\Logger::createLogger($this->queue_name, $this->log_level, $this->log_path . $logFileName);
 }
コード例 #4
0
 public function __construct()
 {
     $this->dataSource = \PHPQueue\Base::backendFactory('Beanstalkd', $this->sourceConfig);
     $this->resultLog = \PHPQueue\Logger::createLogger('BeanstalkSampleLogger', PHPQueue\Logger::INFO, __DIR__ . '/logs/results.log');
 }
コード例 #5
0
ファイル: Runner.php プロジェクト: postelin/php-queue
 protected function createLogger()
 {
     $this->logger = Logger::createLogger($this->queue_name, $this->log_level, $this->getFullLogPath());
 }