Class: Sidekiq::ScheduledSet
- Defined in:
- lib/sidekiq/api.rb
Overview
Allows enumeration of scheduled jobs within Sidekiq. Based on this, you can search/filter for jobs. Here’s an example where I’m selecting all jobs of a certain type and deleting them from the schedule queue.
r = Sidekiq::ScheduledSet.new
r.select do |scheduled|
scheduled.klass == 'Sidekiq::Extensions::DelayedClass' &&
scheduled.args[0] == 'User' &&
scheduled.args[1] == 'setup_new_subscriber'
end.map(&:delete)
Instance Attribute Summary
Attributes inherited from SortedSet
Instance Method Summary collapse
-
#initialize ⇒ ScheduledSet
constructor
A new instance of ScheduledSet.
Methods inherited from JobSet
#delete_by_jid, #delete_by_value, #each, #fetch, #find_job, #schedule
Methods inherited from SortedSet
Constructor Details
#initialize ⇒ ScheduledSet
Returns a new instance of ScheduledSet.
675 676 677 |
# File 'lib/sidekiq/api.rb', line 675 def initialize super "schedule" end |