rs

redis-scheduled

a scheduled module use redis

Showing:

Popularity

Downloads/wk

5

Maintenance

No Maintenance Data Available

Package

Dependencies

1

Size (min+gzip)

16.7KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

REDIS-SCHEDULED

NPM version

Support

redis version must be more than 2.8.0 to support key event subscribe

Installation

npm install redis-scheduled --save

Usage

var scheduled = require('redis-scheduled')({ db:1, prefix: 'scheduled' });

create repeat scheduled

scheduled.every({ from: '2016/11/21 10:21:30', repeat: '30min', name: 'myTask'}, callback);
/**
* from    timestamp, like 'yyyy/MM/dd [hh:mm:ss]', 'yyyy-MM-dd [hh:mm:ss]', msTime
* repeat  unit: s, min, h, day, week
* name    scheduled name
*
* scheduled will run every repeat time after from(include from time)
*/

destory repeat scheduled

scheduled.clearEvery(name);

create scheduled task

scheduled.setTimeout(name, '2016/11/21 10:21:30', callback);
/**
* scheduled only run once
*/

destory scheduled task

scheduled.clearTimeout(name);

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100