Class: Maxwell::Agent::Configuration
- Inherits:
-
Object
- Object
- Maxwell::Agent::Configuration
- Defined in:
- lib/maxwell/agent/configuration.rb
Instance Attribute Summary collapse
-
#host_configuration ⇒ Object
Returns the value of attribute host_configuration.
-
#middleware_chain ⇒ Object
readonly
Returns the value of attribute middleware_chain.
-
#redis_options ⇒ Object
Returns the value of attribute redis_options.
-
#work_poll ⇒ Object
Returns the value of attribute work_poll.
-
#worker_concurrency ⇒ Object
Returns the value of attribute worker_concurrency.
Instance Method Summary collapse
- #default_middleware ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #middleware {|@middleware_chain| ... } ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 |
# File 'lib/maxwell/agent/configuration.rb', line 10 def initialize @worker_concurrency = 25 @middleware_chain = default_middleware @work_poll = 1 @host_configuration = 'config/host_configuration.json' @redis_options = { host: 'localhost', port: 6379 } end |
Instance Attribute Details
#host_configuration ⇒ Object
Returns the value of attribute host_configuration.
6 7 8 |
# File 'lib/maxwell/agent/configuration.rb', line 6 def host_configuration @host_configuration end |
#middleware_chain ⇒ Object (readonly)
Returns the value of attribute middleware_chain.
8 9 10 |
# File 'lib/maxwell/agent/configuration.rb', line 8 def middleware_chain @middleware_chain end |
#redis_options ⇒ Object
Returns the value of attribute redis_options.
6 7 8 |
# File 'lib/maxwell/agent/configuration.rb', line 6 def @redis_options end |
#work_poll ⇒ Object
Returns the value of attribute work_poll.
6 7 8 |
# File 'lib/maxwell/agent/configuration.rb', line 6 def work_poll @work_poll end |
#worker_concurrency ⇒ Object
Returns the value of attribute worker_concurrency.
6 7 8 |
# File 'lib/maxwell/agent/configuration.rb', line 6 def worker_concurrency @worker_concurrency end |
Instance Method Details
#default_middleware ⇒ Object
24 25 26 27 28 |
# File 'lib/maxwell/agent/configuration.rb', line 24 def default_middleware Middleware::Chain.new do |m| m.add Middleware::Logging end end |
#middleware {|@middleware_chain| ... } ⇒ Object
18 19 20 21 22 |
# File 'lib/maxwell/agent/configuration.rb', line 18 def middleware @middleware_chain ||= default_middleware yield @middleware_chain if block_given? @middleware_chain end |