Module: Promiscuous::AMQP::HotBunnies::Subscriber

Includes:
Bunny::Subscriber
Defined in:
lib/promiscuous/amqp/hot_bunnies.rb

Defined Under Namespace

Classes: MetaData

Instance Method Summary collapse

Methods included from Bunny::Subscriber

#ack_message, #postpone_message, #recover, #subscribe

Instance Method Details

#disconnectObject



58
59
60
61
62
63
64
# File 'lib/promiscuous/amqp/hot_bunnies.rb', line 58

def disconnect
  @lock.synchronize do
    @channel = nil
    @subscription.shutdown! rescue nil
    @connection.close rescue nil
  end
end

#subscribe_queue(queue, &block) ⇒ Object



41
42
43
44
45
# File 'lib/promiscuous/amqp/hot_bunnies.rb', line 41

def subscribe_queue(queue, &block)
  queue.subscribe(:ack => true, :blocking => false) do |, payload|
    block.call(MetaData.new(self, ), payload)
  end
end