instance method
read_multi
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
read_multi(*names)
Cache Store API implementation.
Read multiple values at once. Returns a hash of requested keys -> fetched values.
Parameters
-
namesrest
Source
# File activesupport/lib/active_support/cache/redis_cache_store.rb, line 181
def read_multi(*names)
return {} if names.empty?
options = names.extract_options!
options = merged_options(options)
keys = names.map { |name| normalize_key(name, options) }
instrument_multi(:read_multi, keys, options) do |payload|
read_multi_entries(names, **options).tap do |results|
payload[:hits] = results.keys.map { |name| normalize_key(name, options) }
end
end
end
Defined in activesupport/lib/active_support/cache/redis_cache_store.rb line 181
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::RedisCacheStore