Class: Emque::Consuming::Control::Errors
- Inherits:
-
Object
- Object
- Emque::Consuming::Control::Errors
- Includes:
- Helpers
- Defined in:
- lib/emque/consuming/control/errors.rb
Constant Summary collapse
- COMMANDS =
[:clear, :down, :expire_after, :up, :retry]
Instance Method Summary collapse
- #clear ⇒ Object
- #down ⇒ Object
- #expire_after(seconds) ⇒ Object
- #respond_to?(method) ⇒ Boolean
- #retry ⇒ Object
- #up ⇒ Object
Instance Method Details
#clear ⇒ Object
9 10 11 |
# File 'lib/emque/consuming/control/errors.rb', line 9 def clear app.error_tracker.occurrences.clear end |
#down ⇒ Object
13 14 15 16 17 18 |
# File 'lib/emque/consuming/control/errors.rb', line 13 def down if app.error_tracker.limit > 1 config.error_limit = app.error_tracker.limit -= 1 app.verify_error_status end end |
#expire_after(seconds) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/emque/consuming/control/errors.rb', line 20 def expire_after(seconds) unless seconds.is_a?(Integer) raise ArgumentError, "first argument must be an integer" end config.error_expiration = app.error_tracker.expiration = seconds end |
#respond_to?(method) ⇒ Boolean
35 36 37 |
# File 'lib/emque/consuming/control/errors.rb', line 35 def respond_to?(method) COMMANDS.include?(method.to_sym) end |
#retry ⇒ Object
31 32 33 |
# File 'lib/emque/consuming/control/errors.rb', line 31 def retry app.manager.retry_errors end |
#up ⇒ Object
27 28 29 |
# File 'lib/emque/consuming/control/errors.rb', line 27 def up config.error_limit = app.error_tracker.limit += 1 end |