Method: Redis#scan_each
- Defined in:
- lib/redis.rb
#scan_each(options = {}, &block) ⇒ Enumerator
Scan the keyspace
2663 2664 2665 2666 2667 2668 2669 2670 2671 |
# File 'lib/redis.rb', line 2663 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 |