Class: Lagomorph::QueueAdapter

Inherits:
Struct
  • Object
show all
Defined in:
lib/lagomorph/queue_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#queueObject

Returns the value of attribute queue

Returns:

  • (Object)

    the current value of queue



4
5
6
# File 'lib/lagomorph/queue_adapter.rb', line 4

def queue
  @queue
end

Instance Method Details

#nameObject



17
18
19
# File 'lib/lagomorph/queue_adapter.rb', line 17

def name
  queue.name
end

#subscribe(options = {}, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/lagomorph/queue_adapter.rb', line 6

def subscribe(options = {}, &block)
  if Lagomorph.using_bunny?
    queue.subscribe(options) do |delivery_info, properties, payload|
       = MetadataAdapter.new(delivery_info, properties)
      block.call(, payload)
    end
  else
    queue.subscribe(options, &block)
  end
end