Module: PerfectQueue::Backend

Defined in:
lib/perfectqueue/backend.rb,
lib/perfectqueue/backend/rdb_compat.rb

Defined Under Namespace

Classes: RDBCompatBackend

Class Method Summary collapse

Class Method Details

.new_backend(client, config) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/perfectqueue/backend.rb', line 21

def self.new_backend(client, config)
  case config[:type]
  when nil
    raise ConfigError, "'type' option is not set"
  when 'rdb_compat'
    require_backend('rdb_compat')
    RDBCompatBackend.new(client, config)
  end
end

.require_backend(fname) ⇒ Object



31
32
33
# File 'lib/perfectqueue/backend.rb', line 31

def self.require_backend(fname)
  require File.expand_path("backend/#{fname}", File.dirname(__FILE__))
end