def initialize(connection, id, options = {})
super(connection)
@id = id
@exchanges = Hash.new
@queues = Hash.new
@consumers = Hash.new
@options = { :auto_recovery => connection.auto_recovering? }.merge(options)
@auto_recovery = (!!@options[:auto_recovery])
@mutex = Mutex.new
reset_state!
channel_max = if @connection.open?
@connection.channel_max || 65536
else
65536
end
if channel_max != 0 && !(0..channel_max).include?(id)
raise ArgumentError.new("Max channel for the connection is #{channel_max}, given: #{id}")
end
end