當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。