level-mutex-batch
v1.0.0
Published
Make sure only one leveldb batch is running at the time
Downloads
4
Readme
level-mutex-batch
Make sure only one leveldb batch is running at the time
npm install level-mutex-batch
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