Anthony edited this page Apr 29, 2016 · 18 revisions

Sidekiq Pro adds a few API extensions which execute Lua scripts directly in the Redis process for maximum performance.

  • Sidekiq::Queue#delete_job - takes a JID and deletes the corresponding job from the given queue, if it exists. Returns the deleted job or nil.
jid = MyWorker.perform_async
queue =
  • Sidekiq::Queue#delete_by_class - takes a class and deletes all corresponding jobs from the queue. Returns the number of jobs deleted.
queue =
  • Sidekiq::JobSet#find_job(jid) - this Lua-based version is much faster than the pure Ruby version in Sidekiq.

Job Scanning

Using { |job| to find a job based on some criteria can be very slow if you have lots of jobs. Sidekiq Pro provides a scan API for job sets: Retry, Scheduled and Dead. Just pass a string that would match any content within the job payload:"NoMethodError") { |job| job.delete }"FTPWorker") { |job| ... } { |job| ... }

Pausing Queues

Sidekiq Pro allows you to pause processing on any queue via the API:

q ='critical')
q.paused? # => true