Class: Freddy::Adapters::BunnyAdapter::Queue
- Inherits:
-
Object
- Object
- Freddy::Adapters::BunnyAdapter::Queue
- Defined in:
- lib/freddy/adapters/bunny_adapter.rb
Instance Method Summary collapse
- #bind(*args) ⇒ Object
-
#initialize(queue) ⇒ Queue
constructor
A new instance of Queue.
- #message_count ⇒ Object
- #name ⇒ Object
- #subscribe(manual_ack: false) ⇒ Object
Constructor Details
#initialize(queue) ⇒ Queue
Returns a new instance of Queue.
51 52 53 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 51 def initialize(queue) @queue = queue end |
Instance Method Details
#bind(*args) ⇒ Object
55 56 57 58 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 55 def bind(*args) @queue.bind(*args) self end |
#message_count ⇒ Object
64 65 66 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 64 def @queue. end |
#name ⇒ Object
60 61 62 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 60 def name @queue.name end |
#subscribe(manual_ack: false) ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 68 def subscribe(manual_ack: false) @queue.subscribe(manual_ack: manual_ack) do |info, properties, payload| parsed_payload = Payload.parse(payload, properties[:content_encoding]) delivery = Delivery.new( parsed_payload, properties, info.routing_key, info.delivery_tag, info.exchange ) yield(delivery) end end |