Module: Knuckles::Stages::Fetcher
Overview
The fetcher is responsible for bulk retrieval of data from the cache. Fetching is done using a single ‘read_multi` operation, which is multiplexed in caches like Redis or MemCached.
The underlying cache must support ‘read_multi` for the stage to work.
Instance Method Summary collapse
-
#call(prepared, options) ⇒ Object
Fetch all previously cached objects from the configured store.
Instance Method Details
#call(prepared, options) ⇒ Object
Fetch all previously cached objects from the configured store.
37 38 39 40 41 42 43 44 |
# File 'lib/knuckles/stages/fetcher.rb', line 37 def call(prepared, ) results = get_cached(prepared, ) prepared.each do |hash| hash[:result] = results[hash[:key]] hash[:cached?] = !hash[:result].nil? end end |