Module: ArAsyncCounterCache

Defined in:
lib/ar_async_counter_cache/active_record.rb,
lib/ar_async_counter_cache/increment_counters_worker.rb

Defined Under Namespace

Modules: ActiveRecord Classes: IncrementCountersWorker

Class Method Summary collapse

Class Method Details

.redis=(redis) ⇒ Object

If you don’t want to use Resque’s Redis connection to store the temporary counter caches, you can set a different connection here.



22
23
24
25
26
# File 'lib/ar_async_counter_cache/increment_counters_worker.rb', line 22

def self.redis=(redis)
  IncrementCountersWorker.class_eval do
    @redis = redis
  end
end

.resque_job_queue=(queue) ⇒ Object

The default Resque queue is :counter_caches.



7
8
9
10
11
# File 'lib/ar_async_counter_cache/increment_counters_worker.rb', line 7

def self.resque_job_queue=(queue)
  IncrementCountersWorker.class_eval do
    @queue = queue
  end
end

.resque_lock_timeout=(lock_timeout) ⇒ Object

The default lock_timeout is 60 seconds.



14
15
16
17
18
# File 'lib/ar_async_counter_cache/increment_counters_worker.rb', line 14

def self.resque_lock_timeout=(lock_timeout)
  IncrementCountersWorker.class_eval do
    @lock_timeout = lock_timeout
  end
end