Skip to content

coinpit/sequencer-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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))

About

executing promise in a sequence

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published