Sha256: d4423d55780322f3350e27e2ce0994e09626070e454f0ac71ad93defd2e93429

Contents?: true

Size: 827 Bytes

Versions: 9

Compression:

Stored size: 827 Bytes

Contents

require 'eventbus/common_init'

module EventBus
  
  class Queue
    
    def Queue.calc_name(base_name, application_id, prod_level, opts = {})

      application_id ||= EventBus.application_id
      prod_level ||= EventBus.PROD_LEVEL
      
      global_queue = opts.delete(:global_queue) || false
      system_queue = opts.delete(:system_queue) || false
      
      raise "application_id not set!" if application_id.nil?
      raise "prod_level not set!" if prod_level.nil?
      
      application_id = application_id.downcase
      prod_level = prod_level.downcase
      
      queue_name = base_name
      unless global_queue == true
        queue_name = "#{queue_name}.#{prod_level}" 
        queue_name = "#{application_id}.#{queue_name}" unless system_queue
      end

      return queue_name
    end
    
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
eventbus-0.31.1 lib/eventbus/queue.rb
eventbus-0.31 lib/eventbus/queue.rb
eventbus-0.30.2 lib/eventbus/queue.rb
eventbus-0.30.1 lib/eventbus/queue.rb
eventbus-0.30 lib/eventbus/queue.rb
eventbus-0.29 lib/eventbus/queue.rb
eventbus-0.28 lib/eventbus/queue.rb
eventbus-0.27 lib/eventbus/queue.rb
eventbus-0.26 lib/eventbus/queue.rb