lib/bulk_cache_fetcher.rb
# Splits a list of identifiers into two objects. The first is a hash
# of <tt>{cache_key: object}</tt> for all the objects we were able to serve
# from the cache. The second is a list of all of the identifiers for
# objects that weren't cached.
Splits a list of identifiers into two objects. The first is a hash
of {cache_key: object} for all the objects we were able to serve
from the cache. The second is a list of all of the identifiers for
objects that weren't cached.
Splits a list of identifiers into two objects . The first is a hash of { cache_key : object } for all the objects we were able to serve from the cache . The second is a list of all of the identifiers for objects that weren ' t cached .
def partition(object_identifiers)
    uncached_identifiers = object_identifiers.dup
    cache_keys = cache_keys(object_identifiers)
    cached_keys_with_objects = @cache.read_multi(*cache_keys)
    cache_keys.each do |cache_key|
      uncached_identifiers.delete(cache_key) if cached_keys_with_objects.has_key?(cache_key)
    end
    [cached_keys_with_objects, uncached_identifiers]
  end
def partition ( object_identifiers ) uncached_identifiers = object_identifiers . dup cache_keys = cache_keys ( object_identifiers ) cached_keys_with_objects = @cache . read_multi ( * cache_keys ) cache_keys . each do | cache_key | uncached_identifiers . delete ( cache_key ) if cached_keys_with_objects . has_key? ( cache_key ) end [ cached_keys_with_objects , uncached_identifiers ] end
Splits a list of identifiers into two objects.
Splits a list of identifiers into two objects .
object_identifiers