lib/xapian_db/config.rb in xapian_db-1.3.3.1 vs lib/xapian_db/config.rb in xapian_db-1.3.4
- old
+ new
@@ -47,10 +47,14 @@
def resque_queue
@config.instance_variable_get("@_resque_queue") || 'xapian_db'
end
+ def sidekiq_queue
+ @config.instance_variable_get("@_sidekiq_queue") || 'xapian_db'
+ end
+
def term_min_length
@config.instance_variable_get("@_term_min_length") || 1
end
def term_splitter_count
@@ -68,12 +72,12 @@
# ---------------------------------------------------------------------------------
# DSL methods
# ---------------------------------------------------------------------------------
- attr_reader :_database, :_adapter, :_writer, :_beanstalk_daemon, :_resque_queue, :_stemmer, :_stopper,
- :_term_min_length, :_term_splitter_count, :_enabled_query_flags
+ attr_reader :_database, :_adapter, :_writer, :_beanstalk_daemon, :_resque_queue, :_sidekiq_queue,
+ :_stemmer, :_stopper, :_term_min_length, :_term_splitter_count, :_enabled_query_flags
# Set the global database to use
# @param [String] path The path to the database. Either apply a file sytem path or :memory
# for an in memory database
def database(path)
@@ -113,10 +117,11 @@
# Set the index writer
# @param [Symbol] type The writer type; the following adapters are available:
# - :direct ({XapianDb::IndexWriters::DirectWriter})
# - :beanstalk ({XapianDb::IndexWriters::BeanstalkWriter})
# - :resque ({XapianDb::IndexWriters::ResqueWriter})
+ # - :sidekiq ({XapianDb::IndexWriters::SidekiqWriter})
def writer(type)
# We try to guess the writer name
begin
require File.dirname(__FILE__) + "/index_writers/#{type}_writer"
@_writer = XapianDb::IndexWriters.const_get("#{camelize(type.to_s)}Writer")
@@ -134,9 +139,15 @@
# Set the name of the resque queue
# @param [String] name The name of the resque queue
def resque_queue(name)
@_resque_queue = name
+ end
+
+ # Set the name of the sidekiq queue
+ # @param [String] name The name of the sidekiq queue
+ def sidekiq_queue(name)
+ @_sidekiq_queue = name
end
# Set the language.
# @param [Symbol] lang The language; apply the two letter ISO639 code for the language
# @example