stall

0.0.2 • Public • Published

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

Versions

Current Tags

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

Version History

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

Package Sidebar

Install

npm i stall

Weekly Downloads

116

Version

0.0.2

License

beerware

Last publish

Collaborators

  • reqshark