Class: Bunny::Consumer

Inherits:
Qrack::Subscription show all
Defined in:
lib/bunny/consumer.rb

Overview

AMQP consumers are entities that handle messages delivered to them (“push API” as opposed to “pull API”) by AMQP broker. Every consumer is associated with a queue. Consumers can be exclusive (no other consumers can be registered for the same queue) or not (consumers share the queue). In the case of multiple consumers per queue, messages are distributed in round robin manner with respect to channel-level prefetch setting).

Direct Known Subclasses

Subscription, Subscription09

Instance Attribute Summary

Attributes inherited from Qrack::Subscription

#ack, #break_when_empty, #client, #consumer_tag, #delivery_tag, #exclusive, #message_count, #message_max, #queue, #timeout

Instance Method Summary collapse

Methods inherited from Qrack::Subscription

#start

Constructor Details

#initialize(*args) ⇒ Consumer

Returns a new instance of Consumer.



28
29
30
31
# File 'lib/bunny/consumer.rb', line 28

def initialize(*args)
  super(*args)
  @consumer_tag ||= (1..32).to_a.shuffle.join
end