Module: Knuckles::Stages::Writer
Overview
After un-cached models have been serialized they are ready to be cached for future retrieval. Each fully serialized model is written to the cache in a single ‘write_multi` operation if available (using Readthis, for example). Only previously un-cached data will be written to the cache, making the writer a no-op when all of the data was cached initially.
Instance Method Summary collapse
-
#call(objects, _options) ⇒ Object
Write all serialized, but previously un-cached, data to the cache.
Instance Method Details
#call(objects, _options) ⇒ Object
Write all serialized, but previously un-cached, data to the cache.
21 22 23 24 25 26 27 28 29 |
# File 'lib/knuckles/stages/writer.rb', line 21 def call(objects, ) if cache.respond_to?(:write_multi) write_multi(objects) else write_each(objects) end objects end |