Ejemplo n.º 1
0
 /**
  * Starts a monitor process for a job. CLI method
  * @param  string $context   name of the context 
  * @param  int $id           job id
  * @return boolean|int       monitor pid. False if monitor could not be started
  */
 protected static function _start_job_monitor($context, $job_id)
 {
     $callable = array(get_called_class(), 'cli_monitor');
     $params = array($context, $job_id);
     $desc_spec = array(2 => array("file", OperationJob::get_temporary_working_path('monitors_errors.txt'), "a"));
     return CliRunner::exec_on_shell($callable, $params, $desc_spec);
 }
Ejemplo n.º 2
0
 /**
  * Starts an external process to run this operation
  * @return boolean
  */
 public function start($context)
 {
     // $class = get_class($this);
     // $class_name = explode('\\', $class);
     // $class_name = $class_name[ count($class_name) - 1];
     //Register the job without the pid, as we still don't have one
     $job_id = $this->get_id();
     $callable = array('TFramework\\JobManager\\Shell\\JobAccessor', 'cli_act');
     $job_params = $this->get_parameters();
     $params = array($context, $job_id);
     return CliRunner::exec_on_shell($callable, $params, array(2 => array("file", self::get_temporary_working_path('errors.txt'), "a")));
 }