Method: ActiveSupport::Cache::Store#read_multi
- Defined in:
- lib/active_support/cache.rb
#read_multi(*names) ⇒ Object
Reads multiple values at once from the cache. Options can be passed in the last argument.
Some cache implementation may optimize this method.
Returns a hash mapping the names provided to the values found.
544 545 546 547 548 549 550 551 552 553 554 555 556 |
# File 'lib/active_support/cache.rb', line 544 def read_multi(*names) return {} if names.empty? = names. = () keys = names.map { |name| normalize_key(name, ) } instrument_multi :read_multi, keys, do |payload| read_multi_entries(names, **, event: payload).tap do |results| payload[:hits] = results.keys.map { |name| normalize_key(name, ) } end end end |