當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AMQPChannel::exchange_delete方法代碼示例

本文整理匯總了PHP中PhpAmqpLib\Channel\AMQPChannel::exchange_delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP AMQPChannel::exchange_delete方法的具體用法?PHP AMQPChannel::exchange_delete怎麽用?PHP AMQPChannel::exchange_delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhpAmqpLib\Channel\AMQPChannel的用法示例。


在下文中一共展示了AMQPChannel::exchange_delete方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 public function tearDown()
 {
     if ($this->ch) {
         $this->ch->exchange_delete($this->exchange_name);
         $this->ch->close();
     }
     if ($this->conn) {
         $this->conn->close();
     }
 }
開發者ID:adridev,項目名稱:php-amqplib,代碼行數:10,代碼來源:Bug40Test.php

示例2: waitForTask

 private function waitForTask($timeout, $exchange, $queue, callable $completed = null, callable $timedout = null, callable $errored = null)
 {
     // Wait X seconds for the task to be finished
     $message = $this->waitForMessage($queue, $timeout);
     // No response from the worker (the task is not finished)
     if (!$message) {
         // We put in the queue that we timed out
         $this->channel->basic_publish(new AMQPMessage('timeout'), $exchange);
         // Read the first message coming out of the queue
         $message = $this->waitForMessage($queue, 0.5);
         if (!$message) {
             // Shouldn't happen -> error while delivering messages?
             return;
         }
     }
     // If the first message of the queue is a "finished" message from the worker
     if ($message->body == 'finished') {
         if ($completed !== null) {
             call_user_func($completed);
         }
         // Delete the temporary exchange
         $this->channel->exchange_delete($exchange);
     }
     // If the first message of the queue is a "errored" message from the worker
     if ($message->body == 'errored') {
         if ($errored !== null) {
             $e = new \RuntimeException("An error occured in the background task");
             call_user_func($errored, $e);
         }
         // Delete the temporary exchange
         $this->channel->exchange_delete($exchange);
     }
     // If the first message of the queue is our "timeout" message
     if ($message->body == 'timeout') {
         if ($timedout !== null) {
             call_user_func($timedout);
         }
         // Do not delete the temp exchange: still used by the worker
     }
     // Delete the temporary queue
     $this->channel->queue_delete($queue);
 }
開發者ID:basuritas-php,項目名稱:php-Work,代碼行數:42,代碼來源:RabbitMQWorkDispatcher.php

示例3: exchangeDelete

 /**
  * @param $name
  */
 public function exchangeDelete($name)
 {
     $this->_channel->exchange_delete($name);
 }
開發者ID:DeRain,項目名稱:yii-amqp,代碼行數:7,代碼來源:Amqp.php


注:本文中的PhpAmqpLib\Channel\AMQPChannel::exchange_delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。