Sha256: f6579e97ad55eb01a1bc5275bf5ae9bee3766b761a1e3602cecfd3178e1720ca

Contents?: true

Size: 662 Bytes

Versions: 3

Compression:

Stored size: 662 Bytes

Contents

# frozen_string_literal: true

module Karafka
  # FIFO scheduler for messages coming from various topics and partitions
  class Scheduler
    # Schedules jobs in the fifo order
    #
    # @param queue [Karafka::Processing::JobsQueue] queue where we want to put the jobs
    # @param jobs_array [Array<Karafka::Processing::Jobs::Base>] jobs we want to schedule
    def schedule_consumption(queue, jobs_array)
      jobs_array.each do |job|
        queue << job
      end
    end

    # Both revocation and shutdown jobs can also run in fifo by default
    alias schedule_revocation schedule_consumption
    alias schedule_shutdown schedule_consumption
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
karafka-2.0.0.beta4 lib/karafka/scheduler.rb
karafka-2.0.0.beta3 lib/karafka/scheduler.rb
karafka-2.0.0.beta2 lib/karafka/scheduler.rb