Sha256: deca7b72845b73545bacc63d9cbdc93e39e0e140662be9e75ffaf1135327e6a5

Contents?: true

Size: 481 Bytes

Versions: 18

Compression:

Stored size: 481 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Callbacks
    # App level dsl to define callbacks
    module Dsl
      Callbacks::TYPES.each do |callback_type|
        # Allows us to define a block, that will be executed for a given moment
        # @param [Block] block that should be executed after the initialization process
        define_method callback_type do |&block|
          config.callbacks.send(callback_type).push block
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
karafka-1.2.13 lib/karafka/callbacks/dsl.rb
karafka-1.2.12 lib/karafka/callbacks/dsl.rb
karafka-1.2.11 lib/karafka/callbacks/dsl.rb
karafka-1.2.10 lib/karafka/callbacks/dsl.rb
karafka-1.2.9 lib/karafka/callbacks/dsl.rb
karafka-1.2.8 lib/karafka/callbacks/dsl.rb
karafka-1.2.7 lib/karafka/callbacks/dsl.rb
karafka-1.2.6 lib/karafka/callbacks/dsl.rb
karafka-1.2.5 lib/karafka/callbacks/dsl.rb
karafka-1.2.4 lib/karafka/callbacks/dsl.rb
karafka-1.2.3 lib/karafka/callbacks/dsl.rb
karafka-1.2.2 lib/karafka/callbacks/dsl.rb
karafka-1.2.1 lib/karafka/callbacks/dsl.rb
karafka-1.2.0 lib/karafka/callbacks/dsl.rb
karafka-1.2.0.beta4 lib/karafka/callbacks/dsl.rb
karafka-1.2.0.beta3 lib/karafka/callbacks/dsl.rb
karafka-1.2.0.beta2 lib/karafka/callbacks/dsl.rb
karafka-1.2.0.beta1 lib/karafka/callbacks/dsl.rb