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.
17 18 19 |
# File 'lib/dispatch-rider/handlers/base.rb', line 17 def @raw_message end |
Class Method Details
.set_default_retry(amount) ⇒ Object
10 11 12 13 14 |
# File 'lib/dispatch-rider/handlers/base.rb', line 10 def set_default_retry( amount ) define_method(:retry_timeout) do amount end end |
Instance Method Details
#do_process(raw_message) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/dispatch-rider/handlers/base.rb', line 19 def do_process() with_named_process() do @raw_message = process(.body) end rescue Exception => e self.retry if retry_on_failure? raise e end |
#process(message) ⇒ Object
29 30 31 |
# File 'lib/dispatch-rider/handlers/base.rb', line 29 def process() raise NotImplementedError, "Method 'process' not overridden in subclass!" end |