Module: IdentityCache::LoadStrategy::Eager
Instance Method Summary collapse
- #lazy_load {|lazy_loader| ... } ⇒ Object
- #load(cache_fetcher, db_key) {|CacheKeyLoader.load(cache_fetcher, db_key)| ... } ⇒ Object
- #load_batch(db_keys_by_cache_fetcher) {|CacheKeyLoader.load_batch(db_keys_by_cache_fetcher)| ... } ⇒ Object
- #load_multi(cache_fetcher, db_keys) {|CacheKeyLoader.load_multi(cache_fetcher, db_keys)| ... } ⇒ Object
Instance Method Details
#lazy_load {|lazy_loader| ... } ⇒ Object
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
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
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
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 |