Sha256: 059d9a719a0b728d7bf1c2c7056fc19ebf69a365e66f6f99138340b9f6ffb777

Contents?: true

Size: 746 Bytes

Versions: 7

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Extensions
    # Additional Karafka::Attributes map topic attributes that can be used when worker
    # is active and we use sidekiq backend
    module SidekiqAttributesMap
      # Class methods that extend the attributes map class
      module ClassMethods
        # Extra topic fields that we need to have to work with sidekiq backend
        # @return [Array<Symbol>] available topic options
        def topic
          super + %i[interchanger worker]
        end
      end

      # Prepends class methods into attributes map
      # @param base [Class] class that we prepend to
      def self.prepended(base)
        base.singleton_class.prepend ClassMethods
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
karafka-sidekiq-backend-1.2.0 lib/karafka/extensions/sidekiq_attributes_map.rb
karafka-sidekiq-backend-1.2.0.beta4 lib/karafka/extensions/sidekiq_attributes_map.rb
karafka-sidekiq-backend-1.2.0.beta3 lib/karafka/extensions/sidekiq_attributes_map.rb
karafka-sidekiq-backend-1.2.0.beta2 lib/karafka/extensions/sidekiq_attributes_map.rb
karafka-sidekiq-backend-1.2.0.beta1 lib/karafka/extensions/sidekiq_attributes_map.rb
karafka-sidekiq-backend-1.1.0 lib/karafka/extensions/sidekiq_attributes_map.rb
karafka-sidekiq-backend-1.1.0.alpha1 lib/karafka/extensions/sidekiq_attributes_map.rb