예제 #1
0
파일: Finished.php 프로젝트: sgraebner/tp
 protected function _handleSynchronousTask(\Daemon\Task\AbstractTask $task)
 {
     $returnAddress = $task->getReturnAddress();
     $result = $task->getResult();
     $resultMessage = new Task\Result(array('result' => $result));
     $this->_queueManager->sendMessageTo($returnAddress, $resultMessage);
     $this->log('sent result from synchronous task to %s', $returnAddress);
 }
예제 #2
0
 /**
  * @param \Daemon\Task\AbstractTask $task
  * @throws \RuntimeException
  */
 public function removeTaskFromInWorkTasks(Task\AbstractTask $task)
 {
     $taskIdentifier = $task->getIdentifier();
     if (!isset($this->_inWorkTasks[$taskIdentifier])) {
         throw new \RuntimeException(sprintf('task (%s) is not in inWorkTasks', $taskIdentifier));
     }
     unset($this->_inWorkTasks[$taskIdentifier]);
 }
예제 #3
0
파일: Failed.php 프로젝트: sgraebner/tp
 /**
  * @param \Daemon\Task\AbstractTask $task
  */
 protected function _handleSynchronousTask(\Daemon\Task\AbstractTask $task)
 {
     $returnAddress = $task->getReturnAddress();
     $this->_queueManager->sendMessageTo($returnAddress, $this->_message);
     $this->log('sent failed message of synchronous task to %s', $returnAddress);
 }