Class: ThreeScale::Backend::QueueStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/3scale/backend/queue_storage.rb

Class Method Summary collapse

Class Method Details

.connection(env, cfg) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/3scale/backend/queue_storage.rb', line 4

def self.connection(env, cfg)
  init_params = { url: cfg.queues && cfg.queues.master_name }
  if %w(development test).include?(env)
    init_params[:default_url] = '127.0.0.1:6379'
  end
  options = Backend::Storage::Helpers.config_with(cfg.queues,
                                                  options: init_params)

  Storage.new(options)
end