module
Session::RedisUtils
Overview
Utility methods for Redis operations to reduce code duplication
Defined in:
redis_utils.crClass Method Summary
-
.collect_keys(client : Redis, pattern : String, batch_size : Int32 = 100) : Array(String)
Collect all keys matching a pattern
-
.count_keys(client : Redis, pattern : String, batch_size : Int32 = 100) : Int64
Count all keys matching a pattern
-
.delete_keys(client : Redis, pattern : String, batch_size : Int32 = 100) : Int64
Delete all keys matching a pattern
-
.scan_keys(client : Redis, pattern : String, batch_size : Int32 = 100, &block : String -> Nil)
Scan all keys matching a pattern and yield each key
Class Method Detail
def self.collect_keys(client : Redis, pattern : String, batch_size : Int32 = 100) : Array(String)
#
Collect all keys matching a pattern
def self.count_keys(client : Redis, pattern : String, batch_size : Int32 = 100) : Int64
#
Count all keys matching a pattern
def self.delete_keys(client : Redis, pattern : String, batch_size : Int32 = 100) : Int64
#
Delete all keys matching a pattern
def self.scan_keys(client : Redis, pattern : String, batch_size : Int32 = 100, &block : String -> Nil)
#
Scan all keys matching a pattern and yield each key