stall
v0.0.2
Published
similar to yield, stall pauses the node/iojs default runloop. it will block everything else in its surrounding context until completion flag is set. calling done() resumes contextual program flow back to normal asyc
Downloads
609
Readme
stall
pause the node
/iojs
async runloop until you call a done()
callback.
description
similar to yield, stall pauses the node/iojs default runloop. it will block everything else in its surrounding context until its completion flag is set: calling done() resumes contextual program flow back to normal asyc
install
$ npm install stall
use
var stall = require('stall')
//template for a sleep function
var sleep = stall( function (timeout, done) {
//just make sure to call done() to yield back the event loop
setTimeout(done, timeout)
})
console.log('this is a point in time... point A')
sleep(4000)
console.log('point A happened four seconds ago')
test
$ make clean && make && make check