level-mutex-batch

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i level-mutex-batch

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mafintosh