abstract class
Azu::Cache::Store
- Azu::Cache::Store
- Reference
- Object
Overview
Base cache store interface
Direct Known Subclasses
Defined in:
azu/cache.crInstance Method Summary
- #clear : Bool
-
#decrement(key : String, amount : Int32 = 1, ttl : Time::Span | Nil = nil) : Int32 | Nil
Decrement counter WARNING: Base implementation is NOT thread-safe for concurrent access MemoryStore and RedisStore override with atomic implementations
- #delete(key : String) : Bool
- #exists?(key : String) : Bool
-
#fetch(key : String, ttl : Time::Span | Nil = nil, & : -> String) : String
Rails-like fetch method with block support
- #get(key : String) : String | Nil
-
#get(key : String, ttl : Time::Span | Nil = nil, & : -> String) : String
Overloaded get method with block and TTL support (Rails-like)
-
#get_multi(keys : Array(String)) : Hash(String, String | Nil)
Multi-get support
-
#increment(key : String, amount : Int32 = 1, ttl : Time::Span | Nil = nil) : Int32 | Nil
Increment counter (for stores that support it) WARNING: Base implementation is NOT thread-safe for concurrent access MemoryStore and RedisStore override with atomic implementations
- #set(key : String, value : String, ttl : Time::Span | Nil = nil) : Bool
-
#set_multi(values : Hash(String, String), ttl : Time::Span | Nil = nil) : Bool
Multi-set support
- #size : Int32
Instance Method Detail
Decrement counter
WARNING Base implementation is NOT thread-safe for concurrent access MemoryStore and RedisStore override with atomic implementations
Rails-like fetch method with block support
Overloaded get method with block and TTL support (Rails-like)
Increment counter (for stores that support it)
WARNING Base implementation is NOT thread-safe for concurrent access MemoryStore and RedisStore override with atomic implementations
Multi-set support