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.



57
58
59
# File 'lib/upperkut.rb', line 57

def batch_size
  @batch_size
end

#max_waitObject

Returns the value of attribute max_wait.



57
58
59
# File 'lib/upperkut.rb', line 57

def max_wait
  @max_wait
end

#polling_intervalObject

Returns the value of attribute polling_interval.



57
58
59
# File 'lib/upperkut.rb', line 57

def polling_interval
  @polling_interval
end

#strategyObject

Returns the value of attribute strategy.



57
58
59
# File 'lib/upperkut.rb', line 57

def strategy
  @strategy
end

Class Method Details

.defaultObject



59
60
61
62
63
64
65
# File 'lib/upperkut.rb', line 59

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

Instance Method Details

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

Yields:



73
74
75
76
77
# File 'lib/upperkut.rb', line 73

def client_middlewares
  @client_middlewares ||= Middleware::Chain.new
  yield @client_middlewares if block_given?
  @client_middlewares
end

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

Yields:



67
68
69
70
71
# File 'lib/upperkut.rb', line 67

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