struct Cache::RedisStore(K, V)
- Cache::RedisStore(K, V)
- Cache::Store(K, V)
- Struct
- Value
- Object
Overview
A cache store implementation which stores data in Redis.
By default address is equal localhost:6379
cache = Cache::RedisStore(String, String).new(expires_in: 1.minute)
cache.fetch("today") do
Time.now.day_of_week
end
Defined in:
cache/stores/redis_store.crConstructors
Instance Method Summary
-
#fetch(key : K, &)
Fetches data from the
cache, using the givenkey. - #read(key : K)
- #write(key : K, value : V, *, expires_in = @expires_in)
Instance methods inherited from struct Cache::Store(K, V)
fetch(key : K, &)
fetch,
initialize
initialize
Constructor methods inherited from struct Cache::Store(K, V)
new
new
Constructor Detail
Instance Method Detail
def fetch(key : K, &)
#
Description copied from struct Cache::Store(K, V)
Fetches data from the cache, using the given key. If there is data in the cache
with the given key, then that data is returned.
If there is no such data in the cache, then a block will be passed the key
and executed in the event of a cache miss.