Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bulk enqueue support to ActiveJob adapter #422

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Mar 5, 2024

  1. Fix bundler in CI

    [Bundler 2.5 dropped support for Ruby 2.7](https://github.com/rubygems/rubygems/releases/tag/bundler-v2.5.0).
    Since we are testing with Ruby 2.7, we should pin the version of Bundler
    to 2.4.x since this is the last version that's compatible with 2.7.
    dtcristo committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    a3d8beb View commit details
    Browse the repository at this point in the history
  2. Refactor bulk enqueue spec

    Prepare spec for bulk enqueue refactor to support bulk enqueue of jobs
    with differing job class and job options.
    dtcristo committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    ae9508c View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2024

  1. Support bulk enqueue with differing class and options

    Allow bulk enqueue of multiple different job classes and differing job
    options in a single `.bulk_enqueue` block. Each job can now differ by
    job class, queue, priority, run at and tags (in addition to args and
    kwargs).
    dtcristo committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    4835936 View commit details
    Browse the repository at this point in the history
  2. Add bulk enqueue support to ActiveJob adapter

    When using ActiveJob, you can now enqueue jobs in bulk using either
    `Que.bulk_enqueue`:
    ```ruby
    Que.bulk_enqueue do
        TestJobClass.perform_later(1, 2)
        OtherTestJobClass.set(wait: 1.minute, queue: 'custom', priority: 200).perform_later(3, 4)
    end
    ```
    
    Or when running Rails >= 7.1 using `ActiveJob.perform_all_later`:
    ```ruby
    ActiveJob.perform_all_later([
        TestJobClass.new(1, 2),
        OtherTestJobClass.new(3, 4).set(wait: 1.minute, queue: 'custom', priority: 200),
    ])
    ```
    dtcristo committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    691dd68 View commit details
    Browse the repository at this point in the history