Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 976 Bytes

README.md

File metadata and controls

27 lines (18 loc) · 976 Bytes

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();

Build Status Code Climate