Class: Sneakers::Handlers::Oneshot

Inherits:
Object
  • Object
show all
Defined in:
lib/sneakers/handlers/oneshot.rb

Instance Method Summary collapse

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