0.0.2 • Published 10 years ago

stall v0.0.2

Weekly downloads
31
License
beerware
Repository
github
Last release
10 years ago

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
0.0.2

10 years ago

0.0.1

11 years ago