class
Session::LocalCache(T)
- Session::LocalCache(T)
- Reference
- Object
Overview
Local cache with TTL and LRU eviction Generic parameter T can be any type - when used for sessions, instantiate as LocalCache(T) where T is your session class that inherits from Session::Base
Defined in:
cluster.crConstructors
Instance Method Summary
-
#clear : Nil
Clear all entries from the cache
-
#delete(key : String) : Bool
Remove a key from the cache
-
#get(key : String) : T | Nil
Get a value from the cache, returning nil if expired or missing
-
#reset_stats : Nil
Reset statistics counters
-
#set(key : String, value : T) : T
Store a value in the cache with automatic TTL
-
#size : Int32
Count of valid (non-expired) entries
-
#stats : CacheStats
Get cache statistics