Class: Karafka::Routing::Features::Base
- Inherits:
-
Object
- Object
- Karafka::Routing::Features::Base
- Defined in:
- lib/karafka/routing/features/base.rb,
lib/karafka/routing/features/base/expander.rb
Overview
Base for all the features
Direct Known Subclasses
Pro::Routing::Features::Base, ActiveJob, DeadLetterQueue, Declaratives, InlineInsights, ManualOffsetManagement
Defined Under Namespace
Classes: Expander
Class Method Summary collapse
-
.activate ⇒ Object
Extends topic and builder with given feature API.
-
.load_all ⇒ Object
Loads all the features and activates them.
-
.post_setup_all(config) ⇒ Object
Runs post setup routing features configuration operations.
- .pre_setup_all(config) ⇒ Object
Class Method Details
.activate ⇒ Object
Extends topic and builder with given feature API
15 16 17 18 19 20 21 22 |
# File 'lib/karafka/routing/features/base.rb', line 15 def activate Topic.prepend(self::Topic) if const_defined?('Topic', false) Topics.prepend(self::Topics) if const_defined?('Topics', false) ConsumerGroup.prepend(self::ConsumerGroup) if const_defined?('ConsumerGroup', false) Proxy.prepend(self::Proxy) if const_defined?('Proxy', false) Builder.prepend(self::Builder) if const_defined?('Builder', false) Builder.prepend(Base::Expander.new(self)) if const_defined?('Contracts', false) end |
.load_all ⇒ Object
Loads all the features and activates them
25 26 27 |
# File 'lib/karafka/routing/features/base.rb', line 25 def load_all features.each(&:activate) end |
.post_setup_all(config) ⇒ Object
Runs post setup routing features configuration operations
38 39 40 |
# File 'lib/karafka/routing/features/base.rb', line 38 def post_setup_all(config) features.each { |feature| feature.post_setup(config) } end |
.pre_setup_all(config) ⇒ Object
31 32 33 |
# File 'lib/karafka/routing/features/base.rb', line 31 def pre_setup_all(config) features.each { |feature| feature.pre_setup(config) } end |