Class: Alephant::Broker::LoadStrategy::HTTP

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/alephant/broker/load_strategy/http.rb

Defined Under Namespace

Classes: URL

Instance Method Summary collapse

Constructor Details

#initialize(url_generator) ⇒ HTTP

Returns a new instance of HTTP.



18
19
20
# File 'lib/alephant/broker/load_strategy/http.rb', line 18

def initialize(url_generator)
  @url_generator = url_generator
end

Instance Method Details

#load(component_meta) ⇒ Object



22
23
24
25
26
27
# File 'lib/alephant/broker/load_strategy/http.rb', line 22

def load(component_meta)
  fetch_object(component_meta)
rescue
  logger.metric "CacheMiss"
  cache.set(component_meta.cache_key, content(component_meta))
end