pragma-scheduler / 1.0.5 last updated 2 years ago created on Aug 21st 2013

Install

npm install --save pragma-scheduler

Clone

git clone git@github.com:pragma-dudes/pragma-scheduler.git

dependencies

No dependencies listed.

maintainers

pragma-dudes
pragmadash

versions

1.0.5 2 years ago pragma-dudes
39 Downloads yesterday.

readme

Pragma Scheduler NPM version

This a smart scheduler implementation

  • First of all it always waits end of handler work and only then schedule next handler call in specified interval
  • It works using setTimeout not setInterval therefore it does not overflow event loop queue
  • You can specify start delay, interval and can stop scheduler any moment you want

Usage

To install just use NPM

npm install pragma-scheduler
var PragmaScheduler = require('pragma-scheduler'),
    counter = 0,
    scheduler = new PragmaScheduler(3000, 1000, function() {
        console.log(++counter + ' Mississippi');

        if (counter === 5){
            scheduler.stop();
        }
    });

scheduler.start();

Pragma Dudes wish you live long and prosper.

info@pragma-dudes.org

Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.