mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 16:25:14 +00:00
Merge pull request #30 from salimane/upstream
replace is_object with is_array when reserving jobs
This commit is contained in:
commit
4700375d25
@ -60,7 +60,7 @@ class Resque
|
|||||||
* exist, then create it as well.
|
* exist, then create it as well.
|
||||||
*
|
*
|
||||||
* @param string $queue The name of the queue to add the job to.
|
* @param string $queue The name of the queue to add the job to.
|
||||||
* @param object $item Job description as an object to be JSON encoded.
|
* @param array $item Job description as an array to be JSON encoded.
|
||||||
*/
|
*/
|
||||||
public static function push($queue, $item)
|
public static function push($queue, $item)
|
||||||
{
|
{
|
||||||
@ -73,7 +73,7 @@ class Resque
|
|||||||
* return it.
|
* return it.
|
||||||
*
|
*
|
||||||
* @param string $queue The name of the queue to fetch an item from.
|
* @param string $queue The name of the queue to fetch an item from.
|
||||||
* @return object Decoded item from the queue.
|
* @return array Decoded item from the queue.
|
||||||
*/
|
*/
|
||||||
public static function pop($queue)
|
public static function pop($queue)
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ class Resque_Job
|
|||||||
* Instantiate a new instance of a job.
|
* Instantiate a new instance of a job.
|
||||||
*
|
*
|
||||||
* @param string $queue The queue that the job belongs to.
|
* @param string $queue The queue that the job belongs to.
|
||||||
* @param object $payload Object containing details of the job.
|
* @param array $payload array containing details of the job.
|
||||||
*/
|
*/
|
||||||
public function __construct($queue, $payload)
|
public function __construct($queue, $payload)
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ class Resque_Job
|
|||||||
public static function reserve($queue)
|
public static function reserve($queue)
|
||||||
{
|
{
|
||||||
$payload = Resque::pop($queue);
|
$payload = Resque::pop($queue);
|
||||||
if(!is_object($payload)) {
|
if(!is_array($payload)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user