Class: Upperkut::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/upperkut.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#batch_sizeObject

Returns the value of attribute batch_size.



54
55
56
# File 'lib/upperkut.rb', line 54

def batch_size
  @batch_size
end

#max_waitObject

Returns the value of attribute max_wait.



54
55
56
# File 'lib/upperkut.rb', line 54

def max_wait
  @max_wait
end

#polling_intervalObject

Returns the value of attribute polling_interval.



54
55
56
# File 'lib/upperkut.rb', line 54

def polling_interval
  @polling_interval
end

#redisObject

Returns the value of attribute redis.



54
55
56
# File 'lib/upperkut.rb', line 54

def redis
  @redis
end

#strategyObject

Returns the value of attribute strategy.



54
55
56
# File 'lib/upperkut.rb', line 54

def strategy
  @strategy
end

Class Method Details

.defaultObject



56
57
58
59
60
61
62
63
# File 'lib/upperkut.rb', line 56

def self.default
  new.tap do |config|
    config.batch_size       = 1_000
    config.redis            = Redis.new
    config.max_wait         = Integer(ENV['UPPERKUT_MAX_WAIT'] || 20)
    config.polling_interval = Integer(ENV['UPPERKUT_POLLING_INTERVAL'] || 5)
  end
end

Instance Method Details

#middlewares {|@middlewares| ... } ⇒ Object

Yields:



65
66
67
68
69
# File 'lib/upperkut.rb', line 65

def middlewares
  @middlewares ||= init_middleware_chain
  yield @middlewares if block_given?
  @middlewares
end