                 @_getMore()
         @_prompt()
 
-    close: =>
+    close: ->
         unless @_endFlag
             @_conn._end(@_token)
 

        @_contFlag = false
        @_cont = null
        
    _addData: (data) =>
        @_data = @_data.concat data
        @_contFlag = false
        @_prompt()
        @

    _endData: (data) =>
        @_endFlag = true
        @_addData data
        @_contFlag = true
        @

    _prompt: =>
        if @_cont?
            @_cont()

    _getMore: =>
        unless @_contFlag
            @_conn._continueQuery(@_token)
            @_contFlag = true

    hasNext: => !@_endFlag || @_index < @_data.length

    next: (cb) =>
        @_cont = =>
            if @_index < @_data.length
                cb null, @_data[@_index++]

                @_getMore()
        @_prompt()

    each: (cb) ->
        @_cont = =>
            while @_index < @_data.length
                cb null, @_data[@_index++]
