Class: DispatchRider::Handlers::Base
- Inherits:
-
Object
- Object
- DispatchRider::Handlers::Base
- Extended by:
- InheritanceTracking
- Includes:
- NamedProcess
- Defined in:
- lib/dispatch-rider/handlers/base.rb
Instance Attribute Summary collapse
-
#raw_message ⇒ Object
readonly
Returns the value of attribute raw_message.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from InheritanceTracking
Methods included from NamedProcess
Instance Attribute Details
#raw_message ⇒ Object (readonly)
Returns the value of attribute raw_message.
15 16 17 |
# File 'lib/dispatch-rider/handlers/base.rb', line 15 def @raw_message end |
Class Method Details
.set_default_retry(amount) ⇒ Object
8 9 10 11 12 |
# File 'lib/dispatch-rider/handlers/base.rb', line 8 def set_default_retry( amount ) define_method(:retry_timeout) do amount end end |
Instance Method Details
#do_process(raw_message) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/dispatch-rider/handlers/base.rb', line 17 def do_process() with_named_process() do @raw_message = process(.body) end rescue Exception => e self.retry if self.retry_on_failure? raise e end |
#process(message) ⇒ Object
27 28 29 |
# File 'lib/dispatch-rider/handlers/base.rb', line 27 def process() raise NotImplementedError, "Method 'process' not overridden in subclass!" end |