sequencer-js

0.0.2 • Public • Published

sequencer

executes promise in a sequence

 
var sequencer = require('sequencer-js')()
var bluebird = require('bluebird')
 
var globalVariable = 1
 
function aPromise(id, ts) {
  return bluebird.delay(ts).then(function(){
     globalVariable++
    console.log(id, globalVariable)
  })
}
 
sequencer.push(aPromise.bind(undefined, "first", 1000))
sequencer.push(aPromise.bind(undefined, "second", 10))
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    2
  • 0.0.1
    0

Package Sidebar

Install

npm i sequencer-js

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • bharathrao
  • nirmalgupta