Class: Roundhouse::RetrySet
- Defined in:
- lib/roundhouse/api.rb
Overview
Allows enumeration of retries within Roundhouse. 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 retry queue.
r = Roundhouse::RetrySet.new
r.select do |retri|
retri.klass == 'Roundhouse::Extensions::DelayedClass' &&
retri.args[0] == 'User' &&
retri.args[1] == 'setup_new_subscriber'
end.map(&:delete)
Instance Attribute Summary
Attributes inherited from SortedSet
Instance Method Summary collapse
-
#initialize ⇒ RetrySet
constructor
A new instance of RetrySet.
- #retry_all ⇒ Object
Methods inherited from JobSet
#delete_by_jid, #delete_by_value, #each, #fetch, #find_job, #schedule
Methods inherited from SortedSet
Constructor Details
#initialize ⇒ RetrySet
Returns a new instance of RetrySet.
635 636 637 |
# File 'lib/roundhouse/api.rb', line 635 def initialize super 'retry' end |
Instance Method Details
#retry_all ⇒ Object
639 640 641 642 643 |
# File 'lib/roundhouse/api.rb', line 639 def retry_all while size > 0 each(&:retry) end end |