-
Notifications
You must be signed in to change notification settings - Fork 11
Pro API
Mike Perham edited this page Dec 20, 2019
·
22 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.new
queue.delete_job(jid)
-
Sidekiq::Queue#delete_by_class
- takes a class and deletes all corresponding jobs from the queue. Returns the number of jobs deleted. The Standard API notes apply to this method.
MyWorker.perform_async
queue = Sidekiq::Queue.new
queue.delete_by_class(MyWorker)
Sidekiq Pro allows you to pause processing on any queue via the API:
q = Sidekiq::Queue.new('critical')
q.pause!
q.paused? # => true
q.unpause!
Home | The Basics | Best Practices | Using Redis | Error Handling | Advanced Options | Problems?
This wiki is tracked by git and publicly editable. You are welcome to fix errors and typos. Any defacing or vandalism of content will result in your changes being reverted and you being blocked.