In-memory forward iterator for use with the Strata b-tree MVCC tool collection.
JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benchmark
t
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
_advance.js
advance.js
package.json

README.md

In-memory forward iterator for use with the Strata b-tree MVCC tool collection.

function comparator (a, b) { return +a - +b }

var test = cadence(function () {
    var iterator
    async(function () {
        iterator = advance.forward(comparator, [ 1, 2, 3 ])
        iterator.next(async())
    }, function (more) {
        assert.ok(more)
        var items = [], item
        while (item = iterator.get()) {
            items.push(item)
        }
        assert.deepEqual(items, [ 1, 2, 3 ], 'next')
        iterator.next(async())
    }, function (more) {
        assert.ok(!more)
        iterator.unlock(async())
    })
})

test(function (error) { if (error) throw error })