Пример #1
0
 /**
  * Returns live informations about the given task.
  *
  * @return array
  */
 public function getTask(Task $task, $throwException = false)
 {
     try {
         $data = $this->notifier->notify(Notifier::MESSAGE_INFORMATIONS, 2);
     } catch (RuntimeException $e) {
         if ($throwException) {
             throw $e;
         }
         $data = [];
     }
     $taskData = isset($data['jobs']) && isset($data['jobs'][$task->getId()]) ? $data['jobs'][$task->getId()] : [];
     return ['configuration' => $task->getStatus(), 'actual' => isset($taskData['status']) ? $taskData['status'] : Task::STATUS_STOPPED, 'process-id' => isset($taskData['process-id']) ? $taskData['process-id'] : null];
 }
 /**
  * {@inheritDoc}
  */
 public function getStatus()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getStatus', array());
     return parent::getStatus();
 }
Пример #3
0
 private function formatTask(Task $task, $data)
 {
     $taskData = isset($data['jobs']) && isset($data['jobs'][$task->getId()]) ? $data['jobs'][$task->getId()] : [];
     return ['configuration' => $task->getStatus(), 'actual' => isset($taskData['status']) ? $taskData['status'] : Task::STATUS_STOPPED, 'process-id' => isset($taskData['process-id']) ? $taskData['process-id'] : null];
 }