Module: IdentityCache::LoadStrategy::Eager

Extended by:
Eager
Included in:
Eager
Defined in:
lib/identity_cache/load_strategy/eager.rb

Instance Method Summary collapse

Instance Method Details

#lazy_load {|lazy_loader| ... } ⇒ Object

Yields:

  • (lazy_loader)


20
21
22
23
24
25
# File 'lib/identity_cache/load_strategy/eager.rb', line 20

def lazy_load
  lazy_loader = Lazy.new
  yield lazy_loader
  lazy_loader.load_now
  nil
end

#load(cache_fetcher, db_key) {|CacheKeyLoader.load(cache_fetcher, db_key)| ... } ⇒ Object

Yields:

  • (CacheKeyLoader.load(cache_fetcher, db_key))


8
9
10
# File 'lib/identity_cache/load_strategy/eager.rb', line 8

def load(cache_fetcher, db_key)
  yield CacheKeyLoader.load(cache_fetcher, db_key)
end

#load_batch(db_keys_by_cache_fetcher) {|CacheKeyLoader.load_batch(db_keys_by_cache_fetcher)| ... } ⇒ Object

Yields:

  • (CacheKeyLoader.load_batch(db_keys_by_cache_fetcher))


16
17
18
# File 'lib/identity_cache/load_strategy/eager.rb', line 16

def load_batch(db_keys_by_cache_fetcher)
  yield CacheKeyLoader.load_batch(db_keys_by_cache_fetcher)
end

#load_multi(cache_fetcher, db_keys) {|CacheKeyLoader.load_multi(cache_fetcher, db_keys)| ... } ⇒ Object

Yields:

  • (CacheKeyLoader.load_multi(cache_fetcher, db_keys))


12
13
14
# File 'lib/identity_cache/load_strategy/eager.rb', line 12

def load_multi(cache_fetcher, db_keys)
  yield CacheKeyLoader.load_multi(cache_fetcher, db_keys)
end