Sha256: f2db11022579f6e877cb8357bac0eb8e7d4542e6acfb8e53d7338d4ca8adeba1

Contents?: true

Size: 776 Bytes

Versions: 2

Compression:

Stored size: 776 Bytes

Contents

require 'json'
require 'open-uri'
module Maxwell
  module Agent
    class Configuration
      attr_accessor :worker_concurrency, :host_configuration, :work_poll,
        :redis_options
      attr_reader :middleware_chain

      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

      def middleware
        @middleware_chain ||= default_middleware
        yield @middleware_chain if block_given?
        @middleware_chain
      end

      def default_middleware
        Middleware::Chain.new do |m|
          m.add Middleware::Logging
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
maxwell_agent-0.0.7 lib/maxwell/agent/configuration.rb
maxwell_agent-0.0.5 lib/maxwell/agent/configuration.rb