Pagination & rewind feature

This patch will let you refill the queue using pagination, you can also rewind the queue to start at the beginning. This is fully backward compatible.

The queue now takes advantage of pushing multiple values at once when running with Redis >= 2.4

usage:
```
queue = RefillingQueue.new resque_client, "my_queue", :refresh_every => 30.seconds do |page|
  expensive_operation(page).map(&:id)
end
```

when reaching the end of the pages, `queue.pop` will return nil, call `queue.pop` again to restart at the first value.

You can call `queue.rewind` at any time to rewind the queue, next time you call `queue.pop`, the first value will be returned
nope, redis 2 is the server version, not the ruby-library version

On Thu, Nov 6, 2014 at 1:40 PM, Jean-François Ducarroz <
notifications@github.com> wrote:

> In lib/refilling_queue.rb:
>
> >
> >        @client.pipelined do
> >          @client.del @name
> > -        results.each{ |r| @client.rpush @name, r } # TODO https://github.com/redis/redis-rb/issues/253
> > +        if self.class.canPushMultiple?
>
> if we drop redis < 2.4, then wont need anymore to run the specs agains
> redis 2, we can drop the file appraisal, correct?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/grosser/refilling_queue/pull/1/files#r19977579>.
>