Scanner for Redis keyspace
Rediscan lets you iterate over the Redis keyspace and execute a block for each match.
You need to supply a Redis client. There are no restrictions
regarding the type of the Redis client, but it must respond to
call and the signature must be identical to that of
r = Rediscan.new(Redic.new)
Once you have the
Rediscan instance, you can use it as follows:
r.each do |key| # Do something with `key` end
You can also provide
r.each(match: "ost:*", count: 4) do |key| # Do something with `key` end
For the meaning for
count, check the documentation
of the SCAN command.
You can install it using rubygems.
$ gem install rediscan