diff --git a/lib/bunny/channel.rb b/lib/bunny/channel.rb index 79876ed87..8ebe9be5c 100644 --- a/lib/bunny/channel.rb +++ b/lib/bunny/channel.rb @@ -568,7 +568,7 @@ def basic_get(queue, opts = {:ack => true}) # @param [Integer] prefetch_count How many messages can consumers on this channel be given at a time # (before they have to acknowledge or reject one of the earlier received messages) # @param [Boolean] global (false) Ignored, as it is not supported by RabbitMQ - # @param [AMQ::Protocol::Basic::QosOk] RabbitMQ response + # @return [AMQ::Protocol::Basic::QosOk] RabbitMQ response # @see Bunny::Channel#prefetch # @see http://rubybunny.info/articles/queues.html Queues and Consumers guide # @api public diff --git a/lib/bunny/consumer.rb b/lib/bunny/consumer.rb index 438842ace..4132bb760 100644 --- a/lib/bunny/consumer.rb +++ b/lib/bunny/consumer.rb @@ -22,10 +22,14 @@ class Consumer attr_reader :exclusive - # # @param [Bunny::Channel] channel Channel this consumer will use # @param [Bunny::Queue,String] queue Queue messages will be consumed from - # @param + # @param [String] consumer_tag Consumer tag (unique identifier). Generally it is better to let Bunny generate one. + # Empty string means RabbitMQ will generate consumer tag. + # @param [Boolean] no_ack (false) If false, delivered messages will be automatically acknowledged. + # If true, manual acknowledgements will be necessary. + # @param [Boolean] exclusive (false) Should this consumer be exclusive? + # @param [Hash] arguments (nil) Optional arguments that may be used by RabbitMQ extensions, etc # @api public def initialize(channel, queue, consumer_tag = channel.generate_consumer_tag, no_ack = true, exclusive = false, arguments = {}) @channel = channel || raise(ArgumentError, "channel is nil") diff --git a/lib/bunny/exchange.rb b/lib/bunny/exchange.rb index 473f53f8d..780870604 100644 --- a/lib/bunny/exchange.rb +++ b/lib/bunny/exchange.rb @@ -40,7 +40,8 @@ class Exchange # a routing key of "weather.usa.ca.sandiego" and there is a queue Q with this name, # that message will be routed to Q. # - # @param [Bunny::Channel] channel Channel to use. + # @param [Bunny::Channel] channel_or_connection Channel to use. {Bunny::Session} instances + # are only supported for backwards compatibility. # # @example Publishing a messages to the tasks queue # channel = Bunny::Channel.new(connection) @@ -142,7 +143,6 @@ def publish(payload, opts = {}) # Deletes the exchange unless it is a default exchange # - # @param [String] name Exchange name # @param [Hash] opts Options # # @option opts [Boolean] if_unused (false) Should this exchange be deleted only if it is no longer used diff --git a/lib/bunny/queue.rb b/lib/bunny/queue.rb index ea31279d7..f60196c21 100644 --- a/lib/bunny/queue.rb +++ b/lib/bunny/queue.rb @@ -217,18 +217,18 @@ def subscribe_with(consumer, opts = {:block => false}) # @api public # # @example - # conn = Bunny.new - # conn.start + # conn = Bunny.new + # conn.start # - # ch = conn.create_channel - # q = ch.queue("test1") - # x = ch.default_exchange - # x.publish("Hello, everybody!", :routing_key => 'test1') + # ch = conn.create_channel + # q = ch.queue("test1") + # x = ch.default_exchange + # x.publish("Hello, everybody!", :routing_key => 'test1') # - # delivery_info, properties, payload = q.pop + # delivery_info, properties, payload = q.pop # - # puts "This is the message: " + payload + "\n\n" - # conn.close + # puts "This is the message: " + payload + "\n\n" + # conn.close def pop(opts = {:ack => false}, &block) delivery_info, properties, content = @channel.basic_get(@name, opts)