Rafflecopter / node-poll

A simple polling abstraction for repeating an asynchronous action until a desired outcome is achieved.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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) })

About

A simple polling abstraction for repeating an asynchronous action until a desired outcome is achieved.


Languages

Language:JavaScript 100.0%