Class: Karafka::Pro::Processing::ExpansionsSelector

Inherits:
Karafka::Processing::ExpansionsSelector show all
Defined in:
lib/karafka/pro/processing/expansions_selector.rb

Overview

Pro selector of appropriate topic setup based features enhancements.

Instance Method Summary collapse

Instance Method Details

#find(topic) ⇒ Array<Module>

Returns modules with proper expansions we’re suppose to use to enhance the consumer.

Parameters:

Returns:

  • (Array<Module>)

    modules with proper expansions we’re suppose to use to enhance the consumer



23
24
25
26
27
28
29
30
31
# File 'lib/karafka/pro/processing/expansions_selector.rb', line 23

def find(topic)
  # Start with the non-pro expansions
  expansions = super
  expansions << Pro::Processing::Piping::Consumer
  expansions << Pro::Processing::OffsetMetadata::Consumer if topic.offset_metadata?
  expansions << Pro::Processing::AdaptiveIterator::Consumer if topic.adaptive_iterator?
  expansions << Pro::Processing::PeriodicJob::Consumer if topic.periodic_job?
  expansions
end