Sha256: 1168b93d2035c36d19e9b05ae5bbb1e5b2ffa09ad7c80739b3edb574c8035dbe
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
Contents
module Alephant module Broker class ComponentMeta attr_reader :id, :options, :batch_id attr_accessor :cached def initialize(id, batch_id, options) @id = id @batch_id = batch_id @options = options @cached = true end def cache_key "#{id}/#{opts_hash}/#{version}" end def version Broker.config.fetch( 'elasticache_cache_version', 'not available' ).to_s end def key batch_id.nil? ? component_key : renderer_key end def opts_hash Crimp.signature options end private def component_key "#{id}/#{opts_hash}" end def renderer_key "#{batch_id}/#{opts_hash}" end def headers(data) { 'Content-Type' => data[:content_type].to_s, 'X-Version' => version.to_s, 'X-Cached' => cached.to_s }.merge(data[:headers] || {}) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
alephant-broker-2.1.1 | lib/alephant/broker/component_meta.rb |