lib/bunny/channel.rb in bunny-0.9.0.pre8 vs lib/bunny/channel.rb in bunny-0.9.0.pre9

- old
+ new

@@ -445,17 +445,17 @@ # Rejects a message. A rejected message can be requeued or # dropped by RabbitMQ. This method is similar to {Bunny::Channel#reject} but # supports rejecting multiple messages at once, and is usually preferred. # # @param [Integer] delivery_tag Delivery tag to reject - # @param [Boolean] requeue Should this message be requeued instead of dropping it? # @param [Boolean] multiple (false) Should all unacknowledged messages up to this be rejected as well? + # @param [Boolean] requeue (false) Should this message be requeued instead of dropping it? # @see Bunny::Channel#ack # @see http://rubybunny.info/articles/queues.html Queues and Consumers guide # @api public - def nack(delivery_tag, requeue, multiple = false) - basic_nack(delivery_tag, requeue, multiple) + def nack(delivery_tag, multiple = false, requeue = false) + basic_nack(delivery_tag, multiple, requeue) end # @endgroup # @@ -711,31 +711,31 @@ # conn.start # # ch = conn.create_channel # q.subscribe do |delivery_info, properties, payload| # # requeue the message - # ch.basic_nack(delivery_info.delivery_tag, true) + # ch.basic_nack(delivery_info.delivery_tag, false, true) # end # # @example Reject a message # conn = Bunny.new # conn.start # # ch = conn.create_channel # q.subscribe do |delivery_info, properties, payload| # # requeue the message - # ch.basic_nack(delivery_info.delivery_tag, false) + # ch.basic_nack(delivery_info.delivery_tag) # end # # @example Requeue a message fetched via basic.get # conn = Bunny.new # conn.start # # ch = conn.create_channel # # we assume the queue exists and has messages # delivery_info, properties, payload = ch.basic_get("bunny.examples.queue3", :ack => true) - # ch.basic_nack(delivery_info.delivery_tag, true) + # ch.basic_nack(delivery_info.delivery_tag, false, true) # # # @example Requeue multiple messages fetched via basic.get # conn = Bunny.new # conn.start @@ -749,15 +749,15 @@ # ch.basic_nack(delivery_info.delivery_tag, true, true) # # @see http://rubybunny.info/articles/queues.html Queues and Consumers guide # @see http://rubybunny.info/articles/extensions.html RabbitMQ Extensions guide # @api public - def basic_nack(delivery_tag, requeue, multiple = false) + def basic_nack(delivery_tag, multiple = false, requeue = false) raise_if_no_longer_open! @connection.send_frame(AMQ::Protocol::Basic::Nack.encode(@id, delivery_tag, - requeue, - multiple)) + multiple, + requeue)) nil end # Registers a consumer for queue. Delivered messages will be handled with the block