lib/bunny/consumer.rb in bunny-1.0.0.pre2 vs lib/bunny/consumer.rb in bunny-1.0.0.pre3

- old
+ new

@@ -35,10 +35,11 @@ @channel = channel || raise(ArgumentError, "channel is nil") @queue = queue || raise(ArgumentError, "queue is nil") @consumer_tag = consumer_tag @exclusive = exclusive @arguments = arguments + # no_ack set to true = no manual ack = automatic ack. MK. @no_ack = no_ack end # Defines message delivery handler # @api public @@ -85,9 +86,21 @@ end # @return [String] Brief human-readable string representation of this consumer def to_s "#<#{self.class.name}:#{object_id} @channel_id=#{@channel.number} @queue=#{self.queue_name}> @consumer_tag=#{@consumer_tag}>" + end + + # @return [Boolean] true if this consumer uses automatic acknowledgement mode + # @api public + def automatic_acknowledgement? + @no_ack == false + end + + # @return [Boolean] true if this consumer uses manual (explicit) acknowledgement mode + # @api public + def manual_acknowledgement? + @no_ack == true end # # Recovery #