Class: Alephant::Broker::LoadStrategy::S3::Base
- Inherits:
-
Object
- Object
- Alephant::Broker::LoadStrategy::S3::Base
- Includes:
- Logger
- Defined in:
- lib/alephant/broker/load_strategy/s3/base.rb
Instance Attribute Summary collapse
-
#cached ⇒ Object
Returns the value of attribute cached.
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #load(component_meta) ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
14 15 16 |
# File 'lib/alephant/broker/load_strategy/s3/base.rb', line 14 def initialize @cached = true end |
Instance Attribute Details
#cached ⇒ Object
Returns the value of attribute cached.
12 13 14 |
# File 'lib/alephant/broker/load_strategy/s3/base.rb', line 12 def cached @cached end |
Instance Method Details
#load(component_meta) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/alephant/broker/load_strategy/s3/base.rb', line 18 def load() add_s3_headers( fetch_object(), ) rescue logger.metric "S3CacheMiss" add_s3_headers( cache.set( storage_key(), retrieve_object() ), ) end |