Class: Upperkut::Configuration
- Inherits:
-
Object
- Object
- Upperkut::Configuration
- Defined in:
- lib/upperkut.rb
Instance Attribute Summary collapse
-
#batch_size ⇒ Object
Returns the value of attribute batch_size.
-
#max_wait ⇒ Object
Returns the value of attribute max_wait.
-
#polling_interval ⇒ Object
Returns the value of attribute polling_interval.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
Class Method Summary collapse
Instance Method Summary collapse
- #client_middlewares {|@client_middlewares| ... } ⇒ Object
- #server_middlewares {|@server_middlewares| ... } ⇒ Object
Instance Attribute Details
#batch_size ⇒ Object
Returns the value of attribute batch_size.
57 58 59 |
# File 'lib/upperkut.rb', line 57 def batch_size @batch_size end |
#max_wait ⇒ Object
Returns the value of attribute max_wait.
57 58 59 |
# File 'lib/upperkut.rb', line 57 def max_wait @max_wait end |
#polling_interval ⇒ Object
Returns the value of attribute polling_interval.
57 58 59 |
# File 'lib/upperkut.rb', line 57 def polling_interval @polling_interval end |
#strategy ⇒ Object
Returns the value of attribute strategy.
57 58 59 |
# File 'lib/upperkut.rb', line 57 def strategy @strategy end |
Class Method Details
.default ⇒ Object
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
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
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 |