Class: Freddy::Adapters::MarchHareAdapter::Queue
- Inherits:
-
Object
- Object
- Freddy::Adapters::MarchHareAdapter::Queue
- Defined in:
- lib/freddy/adapters/march_hare_adapter.rb
Instance Method Summary collapse
- #bind(*args) ⇒ Object
-
#initialize(queue) ⇒ Queue
constructor
A new instance of Queue.
- #name ⇒ Object
- #subscribe(&block) ⇒ Object
Constructor Details
#initialize(queue) ⇒ Queue
48 49 50 |
# File 'lib/freddy/adapters/march_hare_adapter.rb', line 48 def initialize(queue) @queue = queue end |
Instance Method Details
#bind(*args) ⇒ Object
59 60 61 62 |
# File 'lib/freddy/adapters/march_hare_adapter.rb', line 59 def bind(*args) @queue.bind(*args) self end |
#name ⇒ Object
64 65 66 |
# File 'lib/freddy/adapters/march_hare_adapter.rb', line 64 def name @queue.name end |
#subscribe(&block) ⇒ Object
52 53 54 55 56 57 |
# File 'lib/freddy/adapters/march_hare_adapter.rb', line 52 def subscribe(&block) @queue.subscribe do |, payload| parsed_payload = Payload.parse(payload) block.call(Delivery.new(parsed_payload, , .routing_key)) end end |