simple-polling
v0.3.1
Published
A simple polling abstraction for repeating an asynchronous action until a desired outcome is achieved.
Downloads
2
Readme
var poll = require('simple-polling')
poll(function (cb) { setTimeout(function () { console.log('polling...'); cb(Math.random()) })})
.until(function (num) { return num > 0.9 })
.every(1000)
.timeout_at(15000)
.run(function (num) { console.log('Finished with: ' + num) })