class
CQL::Cache::CacheStoreConfig
- CQL::Cache::CacheStoreConfig
- Reference
- Object
Overview
Configuration for cache store
Defined in:
cache/cache_store.crConstructors
-
.from_env : CacheStoreConfig
Configure from environment variables
-
.from_hash(hash : Hash(String, String | Int32 | Int64 | Bool)) : CacheStoreConfig
Create from Hash (useful for configuration files)
- .new(type : CQL::Cache::CacheStoreType = CacheStoreType::Memory, default_ttl : Time::Span = 1.hour, key_prefix : String = "cql", max_size : Int32 | Nil = nil, memory_max_size : Int32 | Nil = nil, redis_url : String = "redis://localhost:6379/0", redis_pool_size : Int32 = 25, redis_timeout : Time::Span = 5.seconds)
Instance Method Summary
- #default_ttl : Time::Span
- #default_ttl=(default_ttl : Time::Span)
- #key_prefix : String
- #key_prefix=(key_prefix : String)
- #max_size : Int32 | Nil
- #max_size=(max_size : Int32 | Nil)
-
#memory_max_size : Int32 | Nil
Memory cache specific options
-
#memory_max_size=(memory_max_size : Int32 | Nil)
Memory cache specific options
- #redis_pool_size : Int32
- #redis_pool_size=(redis_pool_size : Int32)
- #redis_timeout : Time::Span
- #redis_timeout=(redis_timeout : Time::Span)
-
#redis_url : String
Redis cache specific options
-
#redis_url=(redis_url : String)
Redis cache specific options
- #type : CacheStoreType
- #type=(type : CacheStoreType)
Constructor Detail
def self.from_hash(hash : Hash(String, String | Int32 | Int64 | Bool)) : CacheStoreConfig
#
Create from Hash (useful for configuration files)
def self.new(type : CQL::Cache::CacheStoreType = CacheStoreType::Memory, default_ttl : Time::Span = 1.hour, key_prefix : String = "cql", max_size : Int32 | Nil = nil, memory_max_size : Int32 | Nil = nil, redis_url : String = "redis://localhost:6379/0", redis_pool_size : Int32 = 25, redis_timeout : Time::Span = 5.seconds)
#