1.0.0 • Published 9 years ago

level-mutex-batch v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

level-mutex-batch

Make sure only one leveldb batch is running at the time

npm install level-mutex-batch

build status

Usage

var lmbatch = require('level-mutex-batch')
var batch = lmbatch(db) // db is a levelup

batch([{type:'put', key:'hello', value:'world-1'}], function() {
  ...
})

batch([{type:'put', key:'hello', value:'world-2'}], function() {
  ...
})

batch([{type:'put', key:'hello', value:'world-3'}], function() {
  ...
})

The above example is guaranteed to always produce world-3 as the end result

License

MIT