class method self.perform_all_later

Ruby on Rails edge

Since v7.1.6

Available in: v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Signature

self.perform_all_later(*jobs)

Push many jobs onto the queue at once without running enqueue callbacks. Queue adapters may communicate the enqueue status of each job by setting successfully_enqueued and/or enqueue_error on the passed-in job instances.

Parameters

jobs rest
Source
# File activejob/lib/active_job.rb, line 67
  def self.perform_all_later(*jobs)
    jobs.flatten!
    jobs.group_by(&:queue_adapter).each do |queue_adapter, adapter_jobs|
      instrument_enqueue_all(queue_adapter, adapter_jobs) do
        if queue_adapter.respond_to?(:enqueue_all)
          queue_adapter.enqueue_all(adapter_jobs)
        else
          adapter_jobs.each do |job|
            job.successfully_enqueued = false
            job.enqueue_error = nil
            if job.scheduled_at
              queue_adapter.enqueue_at(job, job.scheduled_at.to_f)
            else
              queue_adapter.enqueue(job)
            end
            job.successfully_enqueued = true
          rescue EnqueueError => e
            job.enqueue_error = e
          end
          adapter_jobs.count(&:successfully_enqueued?)
        end
      end
    end
    nil
  end

Defined in activejob/lib/active_job.rb line 67 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveJob

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close