# File lib/bunny/queue08.rb, line 332
    def unsubscribe(opts = {})
      # Default consumer_tag from subscription if not passed in
      consumer_tag = @default_consumer ? @default_consumer.consumer_tag : opts[:consumer_tag]

      # Must have consumer tag to tell server what to unsubscribe
      raise Bunny::UnsubscribeError,
      "No consumer tag received" if !consumer_tag

      # Cancel consumer
      client.send_frame(Qrack::Protocol::Basic::Cancel.new(:consumer_tag => consumer_tag,:nowait => false))

      method = client.next_method

      client.check_response(method, Qrack::Protocol::Basic::CancelOk, "Error unsubscribing from queue #{name}")

      # Reset subscription
      @default_consumer = nil

      # Return confirmation
      :unsubscribe_ok
    end