Project

rediscan

0.0
No commit activity in last 3 years
No release in over 3 years
Scanner for Redis keyspace
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

Rediscan

Scanner for Redis keyspace

Description

Rediscan lets you iterate over the Redis keyspace and execute a block for each match.

Usage

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 Redic.

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 match and count arguments:

r.each(match: "ost:*", count: 4) do |key|
  # Do something with `key`
end

For the meaning for match and count, check the documentation of the SCAN command.

Installation

You can install it using rubygems.

$ gem install rediscan