A simple run loop.
npm install runs --save
var r = require('runs')()
r.andThen(function () {
console.log('first')
})
r.andThen(function () {
r.wait()
setTimeout(function () {
console.log('second')
r.resume()
}, 500)
r.andThen(function () {
console.log('third')
})
})
r.andThen(function () {
console.log('fourth')
})
r.run()
customQueue
{Function} A function for custom handling on how tasks get queued.
Schedule a synchronous task in the run loop.
Schedule the run loop to wait for a subsequent resume()
call.
Tell the run loop to resume running tasks.
Tell the run loop to cancel the current run.
Start running the tasks queued and call a done
function when all tasks have
finished.
Copyright (c) 2015 Kyle Robinson Young
Licensed under the MIT license.