Class: WaterDrop::Config

Inherits:
Object
  • Object
show all
Includes:
Karafka::Core::Configurable
Defined in:
lib/waterdrop/config.rb

Overview

Configuration object for setting up all options required by WaterDrop

Instance Method Summary collapse

Instance Method Details

#setup {|WaterDrop| ... } ⇒ Object

Configuration method

Yields:

  • Runs a block of code providing a config singleton instance to it

Yield Parameters:



107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/waterdrop/config.rb', line 107

def setup
  configure do |config|
    yield(config)

    merge_kafka_defaults!(config)

    Contracts::Config.new.validate!(config.to_h, Errors::ConfigurationInvalidError)

    ::Rdkafka::Config.logger = config.logger
  end

  self
end