Method: Redis#scan_each
- Defined in:
- lib/redis.rb
#scan_each(options = {}, &block) ⇒ Enumerator
Scan the keyspace
2446 2447 2448 2449 2450 2451 2452 2453 2454 |
# File 'lib/redis.rb', line 2446 def scan_each(={}, &block) return to_enum(:scan_each, ) unless block_given? cursor = 0 loop do cursor, keys = scan(cursor, ) keys.each(&block) break if cursor == "0" end end |