class
CQL::Cache::CacheStore
- CQL::Cache::CacheStore
- Reference
- Object
Overview
Factory class for creating cache store instances
Defined in:
cache/cache_store.crClass Method Summary
-
.config : CacheStoreConfig | Nil
Get current configuration
-
.configure(config : CacheStoreConfig)
Configure the cache store globally
-
.configure_from_env
Configure from environment variables
-
.configure_from_hash(hash : Hash(String, String | Int32 | Int64 | Bool))
Configure from hash
-
.create(config : CacheStoreConfig) : CacheInterface
Create a new cache instance with specific configuration
-
.create(type : String, key_prefix : String | Nil = nil, redis_url : String | Nil = nil, max_size : Int32 | Nil = nil, default_ttl : Time::Span | Nil = nil) : CacheInterface
Create cache with string type for convenience
-
.instance : CacheInterface
Get the singleton cache instance
-
.reset
Reset the singleton instance (useful for testing)
Class Method Detail
def self.configure_from_hash(hash : Hash(String, String | Int32 | Int64 | Bool))
#
Configure from hash
Create a new cache instance with specific configuration
def self.create(type : String, key_prefix : String | Nil = nil, redis_url : String | Nil = nil, max_size : Int32 | Nil = nil, default_ttl : Time::Span | Nil = nil) : CacheInterface
#
Create cache with string type for convenience