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.
58 59 60 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 58 def initialize(queue) @queue = queue end |
Instance Method Details
#bind(*args) ⇒ Object
62 63 64 65 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 62 def bind(*args) @queue.bind(*args) self end |
#message_count ⇒ Object
71 72 73 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 71 def @queue. end |
#name ⇒ Object
67 68 69 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 67 def name @queue.name end |
#subscribe(manual_ack: false) ⇒ Object
75 76 77 78 79 80 81 82 83 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 75 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 |