Method: Autoscaler::CounterCacheRedis#initialize

Defined in:
lib/autoscaler/counter_cache_redis.rb

#initialize(redis, timeout = 5 * 60, worker_type = 'worker') ⇒ CounterCacheRedis

Returns a new instance of CounterCacheRedis.

Parameters:

  • redis (Proc, ConnectionPool, Redis client)

    redis interface Proc: e.g. Sidekiq.method(:redis) ConnectionPool: e.g. what you pass to Sidekiq.redis= Redis client: e.g. Redis.connect

  • timeout (Numeric) (defaults to: 5 * 60)

    number of seconds to allow before expiration

  • worker_type (String) (defaults to: 'worker')

    the name of the worker type, for cache keys



11
12
13
14
15
# File 'lib/autoscaler/counter_cache_redis.rb', line 11

def initialize(redis, timeout = 5 * 60, worker_type = 'worker')
  @redis = redis
  @timeout = timeout
  @worker_type = worker_type
end