Ejemplo n.º 1
0
 /**
  * Process received signals,
  * starts processing signals and arranges for their receival
  */
 public function processSignals()
 {
     $this->_isLive();
     $sig = $this->_tm->getSignals($this->_pid, true);
     if (empty($sig)) {
         return;
     }
     foreach ($sig as $signal) {
         switch ($signal) {
             case self::SIGNAL_SLEEP:
                 $this->_sleep();
                 break;
             case self::SIGNAL_CONTINUE:
                 $this->_continue();
                 break;
             case self::SIGNAL_STOP:
                 $this->stop();
         }
     }
     if ($this->_sleepFlag) {
         $this->_wait();
     }
 }