lib/bulk_cache_fetcher.rb
# Returns a list of objects identified by
# <tt>object_identifiers</tt>. +fetch+ will try to find the objects
# from the cache first. Identifiers for objects that aren't in the
# cache will be passed as an ordered list to <tt>finder_block</tt>,
# where you can find the objects as you see fit. These objects
# should be returned in the same order as the identifiers that were
# passed into the block, because they'll be cached under their
# respective keys. The objects returned by +fetch+ will be returned
# in the same order as the <tt>object_identifiers</tt> passed in.
#
# +options+ will be passed along unmodified when caching newly found
# objects, so you can use it for things like setting cache
# expiration.
Returns a list of objects identified by
object_identifiers. +fetch+ will try to find the objects
from the cache first. Identifiers for objects that aren't in the
cache will be passed as an ordered list to finder_block,
where you can find the objects as you see fit. These objects
should be returned in the same order as the identifiers that were
passed into the block, because they'll be cached under their
respective keys. The objects returned by +fetch+ will be returned
in the same order as the object_identifiers passed in.

+options+ will be passed along unmodified when caching newly found
objects, so you can use it for things like setting cache
expiration.
Returns a list of objects identified by object_identifiers . + fetch + will try to find the objects from the cache first . Identifiers for objects that aren ' t in the cache will be passed as an ordered list to finder_block where you can find the objects as you see fit . These objects should be returned in the same order as the identifiers that were passed into the block because they ' ll be cached under their respective keys . The objects returned by + fetch + will be returned in the same order as the object_identifiers passed in . + options + will be passed along unmodified when caching newly found objects so you can use it for things like setting cache expiration .
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
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
Returns a list of objects identified by
<tt>object_identifiers</tt>.
Returns a list of objects identified by <tt > object_identifiers< / tt > .
object_identifiers
options
finder_block