Skip to content

Commit

Permalink
Do not remove :ack from option hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Stastny aka botanicus committed Jul 5, 2011
1 parent 1464a0a commit dcfac79
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/bunny/queue09.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,10 @@ def delete(opts = {})
#
# @return [Hash] Hash with @:header@, @:payload@ and @:delivery_details@ keys. @:delivery_details@ is a hash @:consumer_tag@, @:delivery_tag@, @:redelivered@, @:exchange@ and @:routing_key@. If the queue is empty the returned hash will contain: @{:header => nil, :payload => :queue_empty, :delivery_details => nil}@. N.B. If a block is provided then the hash will be passed into the block and the return value will be nil.
def pop(opts = {}, &blk)

# do we want to have to provide an acknowledgement?
ack = opts.delete(:ack)

opts = {
:queue => name,
:consumer_tag => name,
:no_ack => !ack,
:no_ack => !opts[:ack],
:nowait => true,
:deprecated_ticket => 0
}.merge(opts)
Expand All @@ -175,7 +171,7 @@ def pop(opts = {}, &blk)

if !queue_empty
# get delivery tag to use for acknowledge
self.delivery_tag = method.delivery_tag if ack
self.delivery_tag = method.delivery_tag if opts[:ack]

header = client.next_payload

Expand Down

0 comments on commit dcfac79

Please sign in to comment.