Sha256: c52274add31f1edf456c760fdd5543f38770d5a5c20877b57108843e8cadf1ab

Contents?: true

Size: 869 Bytes

Versions: 48

Compression:

Stored size: 869 Bytes

Contents

# frozen_string_literal: true

# ActiveJob components to allow for jobs consumption with Karafka
module ActiveJob
  # ActiveJob queue adapters
  module QueueAdapters
    # Karafka adapter for enqueuing jobs
    # This is here for ease of integration with ActiveJob.
    class KarafkaAdapter
      # Enqueues the job using the configured dispatcher
      #
      # @param job [Object] job that should be enqueued
      def enqueue(job)
        ::Karafka::App.config.internal.active_job.dispatcher.call(job)
      end

      # Raises info, that Karafka backend does not support scheduling jobs
      #
      # @param _job [Object] job we cannot enqueue
      # @param _timestamp [Time] time when job should run
      def enqueue_at(_job, _timestamp)
        raise NotImplementedError, 'This queueing backend does not support scheduling jobs.'
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
karafka-2.0.32 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.31 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.30 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.29 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.28 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.27 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.26 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.24 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.23 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.22 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.21 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.20 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.19 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.18 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.17 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.16 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.15 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.14 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.13 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.12 lib/active_job/queue_adapters/karafka_adapter.rb