lobster

very simple FIFO lock primitive

lobster provides a very simple FIFO lock primitive.

var lobstr = require('lobster')
  , lock = lobstr()
 
for (var i = 0; i < 10; i++) {
  lock(function (iyield) {
    console.log(i)
    setTimeout(yield, 50)
  }.bind(null, i))
}