1.1.2 • Published 9 years ago
pensi-scheduler v1.1.2
Pensi-Scheduler
Is a simple event manager for nodejs. You can create different periods to support many types of events and it only uses one setTimout. There is also support for adding meta data for each events.
Note: the period is arbitrary, but I have only tested for hourly and daily tasks.
Sample Usage:
var sched = require('pensi-scheduler');
var TICKS_TWO_SECS = 2 * 1000;
// create a scheduler with two seconds period.
var sm = sched.create({period: TICKS_TWO_SECS});
sm.addTask('A', new Date(), {name : 'my task'}); // execute a minute from now.
sm.once('interval', function(task){
console.log('Running Task', task.name, '...');
sm.stop();
});
sm.start();