Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

delayed_job_bulk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delayed_job_bulk

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DelayedJobBulk

Bulk insert many jobs at once for delayed_job.

Dependencies

  • ruby 2.7+
  • activerecord 6.0+
  • delayed_job 4.1
  • delayed_job_active_record 4.1

Installation

Add this line to your application's Gemfile:

gem 'delayed_job_bulk'

And then execute:

$ bundle

Usage

Build ActiveJob::Base instances and pass them to Delayed::Job::Bulk.enqueue:

class SampleJob < ActiveJob::Base
end

active_jobs = 10.times.map { SampleJob.new('sample') }
jobs = Delayed::Job::Bulk.enqueue(active_jobs)

Return value of Delayed::Job::Bulk.enqueue is an array of Delayed::Job instance:

jobs.size #=> 10
jobs.each do |job|
  job.id  #=> 12345 (id is set only postgresql)
end

Caveats

Callbacks related with ActiveJob (before_enqueue, after_enqueue and around_enqueue) are not called for bulk enqueue.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kanety/delayed_job_bulk.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 23 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc