From 5290fde3ecf0610b405df65218b4ed1cd9f054a3 Mon Sep 17 00:00:00 2001 From: varvar Date: Thu, 31 Dec 2015 10:58:18 +0200 Subject: [PATCH] Add method to retrieve all the items of a list --- lib/Resque.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/Resque.php b/lib/Resque.php index 47291899..ed10f928 100644 --- a/lib/Resque.php +++ b/lib/Resque.php @@ -259,6 +259,20 @@ public static function queues() return $queues; } + /** + * Retrieve all the items of a list with Redis + * + * @return array Array of items. + */ + public static function lrange($list,$start,$stop) + { + $list = self::redis()->lrange($list,$start,$stop ); + if(!is_array($list)) { + $list = array(); + } + return $list; + } + /** * Remove Items from the queue * Safely moving each item to a temporary queue before processing it