Method: Upperkut::Strategies::BufferedQueue#initialize

Defined in:
lib/upperkut/strategies/buffered_queue.rb

#initialize(worker, options = {}) ⇒ BufferedQueue



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/upperkut/strategies/buffered_queue.rb', line 12

def initialize(worker, options = {})
  @options = options
  @redis_options = options.fetch(:redis, {})
  @redis_pool = setup_redis_pool
  @worker     = worker
  @max_wait   = options.fetch(
    :max_wait,
    Integer(ENV['UPPERKUT_MAX_WAIT'] || 20)
  )

  @batch_size = options.fetch(
    :batch_size,
    Integer(ENV['UPPERKUT_BATCH_SIZE'] || 1000)
  )

  @waiting_time = 0
end