abstract class
Components::Cache::CacheStore
- Components::Cache::CacheStore
- Reference
- Object
Overview
Abstract base class for cache stores
Direct Known Subclasses
Defined in:
components/cache/cache_store.crInstance Method Summary
-
#clear : Nil
Clear all cached values
-
#delete(key : String) : Nil
Delete a value from cache
-
#exists?(key : String) : Bool
Check if a key exists
-
#fetch(key : String, expires_in : Time::Span | Nil = nil, &block : -> String) : String
Fetch a value from cache, or compute and store it if not present
-
#read(key : String) : String | Nil
Read a value from cache
-
#stats : Hash(String, Int32 | Int64)
Get statistics about the cache
-
#write(key : String, value : String, expires_in : Time::Span | Nil = nil) : Nil
Write a value to cache
Instance Method Detail
abstract
def fetch(key : String, expires_in : Time::Span | Nil = nil, &block : -> String) : String
#
Fetch a value from cache, or compute and store it if not present
abstract
def write(key : String, value : String, expires_in : Time::Span | Nil = nil) : Nil
#
Write a value to cache