当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Queue::createQueue方法代码示例

本文整理汇总了PHP中Zend_Queue::createQueue方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Queue::createQueue方法的具体用法?PHP Zend_Queue::createQueue怎么用?PHP Zend_Queue::createQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Queue的用法示例。


在下文中一共展示了Zend_Queue::createQueue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDeleteMessage

 public function testDeleteMessage()
 {
     $queue = $this->queue->createQueue('test');
     $queue->send(array(1, 2, 3));
     foreach ($queue->receive() as $message) {
         $queue->deleteMessage($message);
     }
     $values = $this->rediska->getList('Zend_Queue_queue_test');
     $this->assertEquals(array(), $values);
 }
开发者ID:r-kovalenko,项目名称:Rediska,代码行数:10,代码来源:QueueTest.php

示例2: createQueue

 /**
  * Create a queue. Returns the ID of the created queue (typically the URL).
  * It may take some time to create the queue. Check your vendor's
  * documentation for details.
  *
  * @param  string $name
  * @param  array  $options
  * @return string Queue ID (typically URL)
  */
 public function createQueue($name, $options = null)
 {
     try {
         $this->_queues[$name] = $this->_queue->createQueue($name, isset($options[Zend_Queue::TIMEOUT]) ? $options[Zend_Queue::TIMEOUT] : null);
         return $name;
     } catch (Zend_Queue_Exception $e) {
         throw new Zend_Cloud_QueueService_Exception('Error on queue creation: ' . $e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:alefernie,项目名称:intranet,代码行数:18,代码来源:ZendQueue.php

示例3: testReceiveWillRetrieveZeroItems

 /**
  * @group ZF-7650
  */
 public function testReceiveWillRetrieveZeroItems()
 {
     $options = $this->getTestConfig();
     $options['name'] = '/temp-queue/ZF7650';
     $queue = new Zend_Queue('Db', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:omusico,项目名称:logica,代码行数:14,代码来源:DbTest.php

示例4: test_ZF_7650

 public function test_ZF_7650()
 {
     // Zend_Queue_Adapter_Array
     $queue = new Zend_Queue('Array');
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
     // Zend_Queue_Adapter_Memcacheq
     $driverOptions = array();
     if (defined('TESTS_ZEND_QUEUE_MEMCACHEQ_HOST')) {
         $driverOptions['host'] = TESTS_ZEND_QUEUE_MEMCACHEQ_HOST;
     }
     if (defined('TESTS_ZEND_QUEUE_MEMCACHEQ_PORT')) {
         $driverOptions['port'] = TESTS_ZEND_QUEUE_MEMCACHEQ_PORT;
     }
     $options = array('name' => 'ZF7650', 'driverOptions' => $driverOptions);
     $queue = new Zend_Queue('Memcacheq', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
     // Zend_Queue_Adapter_Db
     $driverOptions = array();
     if (defined('TESTS_ZEND_QUEUE_DB')) {
         require_once 'Zend/Json.php';
         $driverOptions = Zend_Json::decode(TESTS_ZEND_QUEUE_DB);
     }
     $options = array('name' => '/temp-queue/ZF7650', 'options' => array(Zend_Db_Select::FOR_UPDATE => true), 'driverOptions' => $driverOptions);
     $queue = new Zend_Queue('Db', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
     // Zend_Queue_Adapter_Activemq
     $driverOptions = array();
     if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_HOST')) {
         $driverOptions['host'] = TESTS_ZEND_QUEUE_ACTIVEMQ_HOST;
     }
     if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_PORT')) {
         $driverOptions['port'] = TESTS_ZEND_QUEUE_ACTIVEMQ_PORT;
     }
     if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_SCHEME')) {
         $driverOptions['scheme'] = TESTS_ZEND_QUEUE_ACTIVEMQ_SCHEME;
     }
     $options = array('driverOptions' => $driverOptions);
     $queue = new Zend_Queue('Activemq', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:travisj,项目名称:zf,代码行数:56,代码来源:ZF-7650Test.php

示例5: testReceiveWillRetrieveZeroItems

 /**
  * @group ZF-7650
  */
 public function testReceiveWillRetrieveZeroItems()
 {
     $options = array('driverOptions' => $this->getTestConfig());
     $queue = new Zend_Queue('Activemq', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:omusico,项目名称:logica,代码行数:13,代码来源:ActivemqTest.php

示例6: testReceiveWillRetrieveZeroItems

 /**
  * @group ZF-7650
  */
 public function testReceiveWillRetrieveZeroItems()
 {
     // Zend_Queue_Adapter_Array
     $queue = new Zend_Queue('Array');
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:omusico,项目名称:logica,代码行数:13,代码来源:ArrayTest.php


注:本文中的Zend_Queue::createQueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。