Skip to content

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

Notifications You must be signed in to change notification settings

Rafflecopter/node-poll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

Stars

Watchers

Forks

Packages

No packages published