Class: Sneakers::Handlers::Oneshot
- Inherits:
-
Object
- Object
- Sneakers::Handlers::Oneshot
- Defined in:
- lib/sneakers/handlers/oneshot.rb
Instance Method Summary collapse
- #acknowledge(hdr, props, msg) ⇒ Object
- #error(hdr, props, msg, err) ⇒ Object
-
#initialize(channel, queue, opts) ⇒ Oneshot
constructor
A new instance of Oneshot.
- #noop(hdr, props, msg) ⇒ Object
- #reject(hdr, props, msg, requeue = false) ⇒ Object
Constructor Details
#initialize(channel, queue, opts) ⇒ Oneshot
Returns a new instance of Oneshot.
4 5 6 7 |
# File 'lib/sneakers/handlers/oneshot.rb', line 4 def initialize(channel, queue, opts) @channel = channel @opts = opts end |
Instance Method Details
#acknowledge(hdr, props, msg) ⇒ Object
9 10 11 |
# File 'lib/sneakers/handlers/oneshot.rb', line 9 def acknowledge(hdr, props, msg) @channel.acknowledge(hdr.delivery_tag, false) end |
#error(hdr, props, msg, err) ⇒ Object
17 18 19 |
# File 'lib/sneakers/handlers/oneshot.rb', line 17 def error(hdr, props, msg, err) reject(hdr, props, msg) end |
#noop(hdr, props, msg) ⇒ Object
21 22 23 |
# File 'lib/sneakers/handlers/oneshot.rb', line 21 def noop(hdr, props, msg) end |
#reject(hdr, props, msg, requeue = false) ⇒ Object
13 14 15 |
# File 'lib/sneakers/handlers/oneshot.rb', line 13 def reject(hdr, props, msg, requeue=false) @channel.reject(hdr.delivery_tag, requeue) end |