Example #1
0
 /**
  * @param null $queueName
  *
  * @return bool
  */
 public function subscribe($queueName = null)
 {
     if (empty($queueName)) {
         $queueName = INIT::$DQF_PROJECTS_TASKS_QUEUE_NAME;
     }
     return parent::subscribe($queueName);
 }
Example #2
0
<?php

set_time_limit(0);
include "main.php";
$UNIQUID = uniqid('', true);
$my_pid = getmypid();
$parent_pid = posix_getppid();
$RUNNING = true;
Log::$fileName = "tm_analysis.log";
try {
    $amqHandlerSubscriber = new Analysis_QueueHandler();
    $amqHandlerSubscriber->subscribe();
    $amqHandlerSubscriber->getRedisClient()->rpush(Constants_AnalysisRedisKeys::FAST_PID_LIST, $my_pid);
} catch (Exception $ex) {
    $msg = "****** No REDIS/AMQ instances found. Exiting. ******";
    _TimeStampMsg($msg);
    _TimeStampMsg($ex->getMessage());
    die;
}
// PROCESS CONTROL FUNCTIONS
function sigSwitch($signo)
{
    global $RUNNING;
    switch ($signo) {
        case SIGTERM:
        case SIGINT:
        case SIGHUP:
            $RUNNING = false;
            break;
        default:
            break;