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.11 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.10 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.9 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.8 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.7 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.6 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.5 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.4 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.3 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.2 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.1 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.rc6 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.rc5 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.rc4 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.rc3 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.rc2 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.rc1 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.beta5 lib/active_job/queue_adapters/karafka_adapter.rb
karafka-2.0.0.beta4 lib/active_job/queue_adapters/karafka_adapter.rb