Class: SneakersRequeueOnError::Handler
- Inherits:
-
Object
- Object
- SneakersRequeueOnError::Handler
- Defined in:
- lib/sneakers_requeue_on_error/handler.rb
Instance Method Summary collapse
- #acknowledge(hdr, _props, _msg) ⇒ Object
- #error(hdr, props, msg, _err) ⇒ Object
-
#initialize(channel, _queue, opts) ⇒ Handler
constructor
A new instance of Handler.
- #noop(hdr, props, msg) ⇒ Object
- #reject(hdr, _props, _msg, requeue = false) ⇒ Object
- #timeout(hdr, props, msg) ⇒ Object
Constructor Details
#initialize(channel, _queue, opts) ⇒ Handler
Returns a new instance of Handler.
3 4 5 6 |
# File 'lib/sneakers_requeue_on_error/handler.rb', line 3 def initialize(channel, _queue, opts) @channel = channel @opts = opts end |
Instance Method Details
#acknowledge(hdr, _props, _msg) ⇒ Object
8 9 10 |
# File 'lib/sneakers_requeue_on_error/handler.rb', line 8 def acknowledge(hdr, _props, _msg) @channel.acknowledge(hdr.delivery_tag, false) end |
#error(hdr, props, msg, _err) ⇒ Object
16 17 18 |
# File 'lib/sneakers_requeue_on_error/handler.rb', line 16 def error(hdr, props, msg, _err) reject(hdr, props, msg, true) end |
#noop(hdr, props, msg) ⇒ Object
24 25 |
# File 'lib/sneakers_requeue_on_error/handler.rb', line 24 def noop(hdr, props, msg) end |
#reject(hdr, _props, _msg, requeue = false) ⇒ Object
12 13 14 |
# File 'lib/sneakers_requeue_on_error/handler.rb', line 12 def reject(hdr, _props, _msg, requeue = false) @channel.reject(hdr.delivery_tag, requeue) end |
#timeout(hdr, props, msg) ⇒ Object
20 21 22 |
# File 'lib/sneakers_requeue_on_error/handler.rb', line 20 def timeout(hdr, props, msg) reject(hdr, props, msg) end |