Nutella Peanut-Butter Marshmallow

    redis-scheduled

    0.3.3 • Public • Published

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

    Install

    npm i redis-scheduled

    DownloadsWeekly Downloads

    6

    Version

    0.3.3

    License

    ISC

    Last publish

    Collaborators

    • xuezi