lib/bunny/channel.rb in bunny-0.9.0.pre4 vs lib/bunny/channel.rb in bunny-0.9.0.pre5

- old
+ new

@@ -16,11 +16,11 @@ # # API # attr_accessor :id, :connection, :status, :work_pool - attr_reader :next_publish_seq_no + attr_reader :next_publish_seq_no, :queues, :exchanges def initialize(connection = nil, id = nil, work_pool = ConsumerWorkPool.new(1)) @connection = connection @id = id || @connection.next_channel_id @@ -45,10 +45,13 @@ @next_publish_seq_no = 0 end def open @connection.open_channel(self) + # clear last channel error + @last_channel_error = nil + @status = :open self end @@ -591,10 +594,11 @@ @confirms_continuations.pop @only_acks_received end + # # Implementation # def register_consumer(consumer_tag, consumer) @@ -733,16 +737,24 @@ # Synchronizes given block using this channel's mutex. # @api public def synchronize(&block) @publishing_mutex.synchronize(&block) end + + def deregister_queue(queue) + @queues.delete(queue.name) + end def register_queue(queue) @queues[queue.name] = queue end def find_queue(name) @queues[name] + end + + def deregister_exchange(exchange) + @exchanges.delete(exchange.name) end def register_exchange(exchange) @exchanges[exchange.name] = exchange end