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


PHP Resque::pop方法代码示例

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


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

示例1: reserve

 /**
  * Find the next available job from the specified queue and return an
  * instance of Resque_Job for it.
  *
  * @param string $queue The name of the queue to check for a job in.
  * @return null|object Null when there aren't any waiting jobs, instance of Resque_Job when a job was found.
  */
 public static function reserve($queue)
 {
     $payload = Resque::pop($queue);
     if (!is_array($payload)) {
         return false;
     }
     return new Resque_Job($queue, $payload);
 }
开发者ID:SoftwarePunt,项目名称:php-resque,代码行数:15,代码来源:Job.php

示例2: reserve

 /**
  * Find the next available job from the specified queue and return an
  * instance of Resque_Job for it.
  *
  * @param string $queue The name of the queue to check for a job in.
  * @return null|object Null when there aren't any waiting jobs, instance of Resque_Job when a job was found.
  */
 public static function reserve($queue, $sm = null)
 {
     $payload = \Resque::pop($queue);
     if (!is_array($payload)) {
         return false;
     }
     return new ResqueJob($queue, $payload, $sm);
 }
开发者ID:ppaulis,项目名称:zf2-resque,代码行数:15,代码来源:ResqueJob.php

示例3: reserve

	/**
	 * Find the next available job from the specified queue and return an
	 * instance of Resque_Job for it.
	 *
	 * @param string $queue The name of the queue to check for a job in.
	 * @return null|object Null when there aren't any waiting jobs, instance of Resque_Job when a job was found.
	 */
	public static function reserve($queue)
	{
		$payload = Resque::pop($queue);
		if(!$payload) {
			return;
		}

		return new Resque_Job($queue, $payload);
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:16,代码来源:Job.php

示例4: reserve

 public static function reserve($queue)
 {
     $payload = Resque::pop($queue);
     if (!is_array($payload)) {
         return false;
     }
     if (isset($payload['closure'])) {
         return new Resque_Job_Closure($queue, $payload);
     } else {
         return new Resque_Job_Class($queue, $payload);
     }
 }
开发者ID:snikius,项目名称:php-resque,代码行数:12,代码来源:Reserve.php

示例5: testDequeueSeveralItemsWithArgs

 public function testDequeueSeveralItemsWithArgs()
 {
     // GIVEN
     $queue = 'jobs';
     $args = array('foo' => 1, 'bar' => 10);
     $removeArgs = array('foo' => 1, 'bar' => 2);
     Resque::enqueue($queue, 'Test_Job_Dequeue9', $args);
     Resque::enqueue($queue, 'Test_Job_Dequeue9', $removeArgs);
     Resque::enqueue($queue, 'Test_Job_Dequeue9', $removeArgs);
     $this->assertEquals(Resque::size($queue), 3);
     // WHEN
     $test = array('Test_Job_Dequeue9' => $removeArgs);
     $removedItems = Resque::dequeue($queue, $test);
     // THEN
     $this->assertEquals($removedItems, 2);
     $this->assertEquals(Resque::size($queue), 1);
     $item = Resque::pop($queue);
     $this->assertInternalType('array', $item['args']);
     $this->assertEquals(10, $item['args'][0]['bar'], 'Wrong items were dequeued from queue!');
 }
开发者ID:SoftwarePunt,项目名称:php-resque,代码行数:20,代码来源:JobTest.php


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