lib/rabbitmq/client.rb
def channel(id=nil)
      id = allocate_channel(id)
      finalizer = Proc.new { release_channel(id) }
      Channel.new(self, @conn, id, finalizer)
    end
def channel(id=nil)
      id = allocate_channel(id)
      finalizer = Proc.new { release_channel(id) }
      Channel.new(self, @conn, id, finalizer)
    end
Open a new channel of communication and return a new {Channel} object
 with convenience methods for communicating on that channel. The
 channel will be automatically released if the {Channel} instance is
 garbage collected, or if the {Client} connection is {#close}d.

 @param id [Integer,nil] The channel id number to use. If nil or not
   given, a unique channel number will be chosen automatically.
 @raise [ArgumentError] If the given channel id number is not unique or
   if the given channel id number is greater than {#max_channels}.
 @return [Channel] The new channel handle.