Class: Karafka::Pro::Loader
- Inherits:
-
Object
- Object
- Karafka::Pro::Loader
- Defined in:
- lib/karafka/pro/loader.rb
Overview
Loader requires and loads all the pro components only when they are needed
Constant Summary collapse
- FORCE_LOADED =
There seems to be a conflict in between using two Zeitwerk instances and it makes lookups for nested namespaces instead of creating them. We require those not to deal with this and then all works as expected
%w[ active_job/dispatcher processing/jobs/consume_non_blocking processing/strategies/base routing/features/base encryption encryption/cipher encryption/setup/config encryption/contracts/config encryption/messages/parser ].freeze
Class Method Summary collapse
-
.post_setup(config) ⇒ Object
Runs post setup features configuration operations.
-
.pre_setup(config) ⇒ Object
Loads all the pro components and configures them wherever it is expected.
-
.require_all ⇒ Object
Requires all the components without using them anywhere.
Class Method Details
.post_setup(config) ⇒ Object
Runs post setup features configuration operations
63 64 65 |
# File 'lib/karafka/pro/loader.rb', line 63 def post_setup(config) features.each { |feature| feature.post_setup(config) } end |
.pre_setup(config) ⇒ Object
Loads all the pro components and configures them wherever it is expected
52 53 54 55 56 57 58 |
# File 'lib/karafka/pro/loader.rb', line 52 def pre_setup(config) features.each { |feature| feature.pre_setup(config) } reconfigure(config) load_topic_features end |
.require_all ⇒ Object
Requires all the components without using them anywhere
41 42 43 44 45 46 47 |
# File 'lib/karafka/pro/loader.rb', line 41 def require_all FORCE_LOADED.each { |file| require_relative(file) } PRO_LOADER.push_dir(Karafka.core_root.join('pro'), namespace: Karafka::Pro) PRO_LOADER.setup PRO_LOADER.eager_load end |