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, 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.
Class Method Details
.activate ⇒ Object
Extends topic and builder with given feature API
15 16 17 18 19 20 |
# File 'lib/karafka/routing/features/base.rb', line 15 def activate Topic.prepend(self::Topic) if const_defined?('Topic', false) Proxy.prepend(self::Builder) if const_defined?('Builder', false) Builder.prepend(self::Builder) if const_defined?('Builder', false) Builder.prepend(Base::Expander.new(self)) if const_defined?('Contract', false) end |
.load_all ⇒ Object
Loads all the features and activates them
23 24 25 26 27 28 29 |
# File 'lib/karafka/routing/features/base.rb', line 23 def load_all ObjectSpace .each_object(Class) .select { |klass| klass < self } .sort_by(&:to_s) .each(&:activate) end |