Sha256: 6c0ef4636c8b6b45b5666cc9fac6f661fdc6938140f7d57737874bce9169a6a8
Contents?: true
Size: 1.1 KB
Versions: 5
Compression:
Stored size: 1.1 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 Celluloid or 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