Method: Readthis::Cache#write_multi
- Defined in:
- lib/readthis/cache.rb
#write_multi(hash, options = {}) ⇒ Object
Write multiple key value pairs simultaneously. This is an atomic operation that will always succeed and will overwrite existing values.
This is a non-standard, but useful, cache method.
319 320 321 322 323 324 325 326 327 |
# File 'lib/readthis/cache.rb', line 319 def write_multi(hash, = {}) = () invoke(:write_multi, hash.keys) do |store| store.multi do hash.each { |key, value| write_entity(key, value, store, ) } end end end |