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); }
/** * @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]); }
/** * @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); }