Skip to content

Commit 5290fde

Browse files
committed
Add method to retrieve all the items of a list
1 parent df69e89 commit 5290fde

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/Resque.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,20 @@ public static function queues()
259259
return $queues;
260260
}
261261

262+
/**
263+
* Retrieve all the items of a list with Redis
264+
*
265+
* @return array Array of items.
266+
*/
267+
public static function lrange($list,$start,$stop)
268+
{
269+
$list = self::redis()->lrange($list,$start,$stop );
270+
if(!is_array($list)) {
271+
$list = array();
272+
}
273+
return $list;
274+
}
275+
262276
/**
263277
* Remove Items from the queue
264278
* Safely moving each item to a temporary queue before processing it

0 commit comments

Comments
 (0)