class BulkCacheFetcher
def fetch(object_identifiers, options = {}, &finder_block)
objects, so you can use it for things like setting cache
+options+ will be passed along unmodified when caching newly found
in the same order as the object_identifiers passed in.
respective keys. The objects returned by +fetch+ will be returned
passed into the block, because they'll be cached under their
should be returned in the same order as the identifiers that were
where you can find the objects as you see fit. These objects
cache will be passed as an ordered list to finder_block,
from the cache first. Identifiers for objects that aren't in the
object_identifiers. +fetch+ will try to find the objects
Returns a list of objects identified by
def fetch(object_identifiers, options = {}, &finder_block) object_identifiers = normalize(object_identifiers) cached_keys_with_objects, uncached_identifiers = partition(object_identifiers) found_objects = find(uncached_identifiers, options, &finder_block) coalesce(cache_keys(object_identifiers), cached_keys_with_objects, found_objects) end