Sha256: 4655606aede3ce4186ad736cc9311f5bf30238eeacb38d1d32f35f3d45b20a4e

Contents?: true

Size: 993 Bytes

Versions: 83

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Routing
    module Features
      class ActiveJob < Base
        # Topic extensions to be able to check if given topic is ActiveJob topic
        module Topic
          # @param active [Boolean] should this topic be considered one working with ActiveJob
          #
          # @note Since this feature supports only one setting (active), we can use the old API
          # where the boolean would be an argument
          def active_job(active = false)
            @active_job ||= Config.new(active: active)
          end

          # @return [Boolean] is this an ActiveJob topic
          def active_job?
            active_job.active?
          end

          # @return [Hash] topic with all its native configuration options plus active job
          #   namespace settings
          def to_h
            super.merge(
              active_job: active_job.to_h
            ).freeze
          end
        end
      end
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
karafka-2.4.17 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.16 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.15 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.14 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.13 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.12 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.11 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.10 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.9 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.8 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.7 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.6 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.5 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.4 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.3 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.0 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.0.rc1 lib/karafka/routing/features/active_job/topic.rb
karafka-2.3.4 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.0.beta2 lib/karafka/routing/features/active_job/topic.rb
karafka-2.4.0.beta1 lib/karafka/routing/features/active_job/topic.rb