# File lib/bunny/queue09.rb, line 14
          def initialize(client, name, opts = {})
                        # check connection to server
                        raise Bunny::ConnectionError, 'Not connected to server' if client.status == :not_connected
                        
            @client = client
            @opts   = opts
      @delivery_tag = nil

      # Queues without a given name are named by the server and are generally
      # bound to the process that created them.
      if !name
        opts = {
          :passive => false,
          :durable => false,
          :exclusive => true,
          :auto_delete => true,
                                        :reserved_1 => 0
        }.merge(opts)
      end
        
                        # ignore the :nowait option if passed, otherwise program will hang waiting for a
                        # response that will not be sent by the server
                        opts.delete(:nowait)
                        
            client.send_frame(
              Qrack::Protocol09::Queue::Declare.new({ :queue => name || '', :nowait => false, :reserved_1 => 0 }.merge(opts))
            )
        
      method = client.next_method

                        client.check_response(method,        Qrack::Protocol09::Queue::DeclareOk, "Error declaring queue #{name}")

      @name = method.queue
                        client.queues[@name] = self
          end