Utility methods for Redis operations to reduce code duplication
Class methods
collect_keys(client :
Redis, pattern :
String, batch_size :
Int32 = 100) :
Array(
String)
Collect all keys matching a pattern
Sourcecount_keys(client :
Redis, pattern :
String, batch_size :
Int32 = 100) :
Int64 Count all keys matching a pattern
Sourcedelete_keys(client :
Redis, pattern :
String, batch_size :
Int32 = 100) :
Int64 Delete all keys matching a pattern
Sourcescan_keys(client :
Redis, pattern :
String, batch_size :
Int32 = 100, &block :
String ->
Nil)
Scan all keys matching a pattern and yield each key
Source