Sha256: 72b48bf63fe7e2c101b1c5eed5a3381359a505cdf2b7468e8875235a80baf83c
Contents?: true
Size: 1.09 KB
Versions: 5
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true module Karafka module Setup # Configurators module is used to enclose all the external dependencies configurations class Configurators # Karafka has come components that it relies on (like Sidekiq) # We need to configure all of them only when the framework was set up. # Any class that descends from this one will be automatically invoked upon setup (after it) # @example Configure an Example class # class ExampleConfigurator < Base # def setup # ExampleClass.logger = Karafka.logger # ExampleClass.redis = config.redis # end # end class Base extend ActiveSupport::DescendantsTracker attr_reader :config # @param config [Karafka::Config] config instance # @return [Karafka::Config::Base] configurator for a given component def initialize(config) @config = config end # This method needs to be implemented in a subclass def setup raise NotImplementedError end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems