config() публичный Метод

Gets config for this cron
public config ( ) : object
Результат object Returns configuration options for the task
Пример #1
0
 /**
  * {@inheritdoc}
  * @see \Scalr\System\Zmq\Cron\AbstractTask::config()
  */
 public function config()
 {
     $config = parent::config();
     if ($config->daemon) {
         //Report a warning to the log
         trigger_error(sprintf("Demonized mode is not allowed for '%s' task. Forcing normal mode.", $this->name), E_USER_WARNING);
         //Forces normal mode
         $config->daemon = false;
     }
     return $config;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  * @see \Scalr\System\Zmq\Cron\AbstractTask::config()
  */
 public function config()
 {
     $config = parent::config();
     if ($config->daemon) {
         //Report a warning to log
         trigger_error(sprintf("Demonized mode is not allowed for '%s' job.", $this->name), E_USER_WARNING);
         //Forces normal mode
         $config->daemon = false;
     }
     if ($config->workers != 1) {
         //It cannot be performed through ZMQ MDP as execution time exceeds heartbeat
         trigger_error(sprintf("It is allowed only one worker for the '%s' job.", $this->name), E_USER_WARNING);
         $config->workers = 1;
     }
     return $config;
 }