コード例 #1
0
ファイル: RPCPublisher.php プロジェクト: fliglio/chinchilla
 public function publishReply(Message $msg, MappableApi $api)
 {
     if (!$msg->getReplyTo()) {
         return null;
     }
     $queueName = $msg->getReplyTo();
     $worker = new WorkerPublisher($this->connection, $queueName);
     return $worker->publish($api, ['expiration' => ['T', strtotime('+5 minutes')]], $msg->getId());
 }
コード例 #2
0
 public function create(Context $context, $paramName)
 {
     $headers = $context->getRequest()->getHeaders();
     $msg = new Message();
     $created = isset($headers['created']) ? $headers['created'] : null;
     $expiration = isset($headers['expiration']) ? $headers['expiration'] : null;
     $msg->setHeaders($headers);
     $msg->setExpiration($expiration);
     $msg->setCreated($created);
     return $msg;
 }