예제 #1
0
파일: Predis.php 프로젝트: zircote/rhubarb
 /**
  * @param \Rhubarb\Task $task
  */
 public function publishTask(\Rhubarb\Task $task)
 {
     $task->getMessage()->setContentEncoding(Rhubarb::CONTENT_ENCODING_UTF8);
     if (!$task->getMessage()->getPropRoutingKey()) {
         $task->getMessage()->setPropRoutingKey('celery');
     }
     if (!$task->getMessage()->getCorrelationId()) {
         $task->getMessage()->setCorrelationId($task->getId());
     }
     if (!$task->getMessage()->getReplyTo()) {
         $task->getMessage()->setReplyTo($task->getId());
     }
     $task->getMessage()->setPropDeliveryMode(2)->setPropDeliveryTag(2);
     $task->getMessage()->setBodyEncoding(Rhubarb::CONTENT_ENCODING_BASE64);
     $task->toArray();
     $this->getConnection()->lpush($task->getMessage()->getPropExchange(), (string) $task->getMessage());
 }
예제 #2
0
파일: Test.php 프로젝트: zircote/rhubarb
 /**
  * @param \Rhubarb\Task $task
  */
 public function publishTask(\Rhubarb\Task $task)
 {
     $taskArray = $task->toArray();
     $this->published = json_encode($taskArray);
 }