egg-kue

    0.1.2 • Public • Published

    egg-kue

    NPM version

    A priority job queue backed by redis, built for eggjs.

    Install

    $ npm i egg-kue --save

    Usage

    // {app_root}/config/plugin.js
    exports.kue = {
      enable: true,
      package: 'egg-kue',
    };

    Configuration

    // {app_root}/config/config.default.js
    'use strict';
    exports.kue = {
      app : true,
      agent : false,
      client: {
        queuePrefix: 'q',
        redis: {
          port: 6379,
          host: '127.0.0.1',
          auth: '',
          db: 3,
          // see https://github.com/mranney/node_redis#rediscreateclient
          options: {
          },
        },
      },
      // clients: {}
    };

    see config/config.default.js for more detail.

    Example

    app.kue.process('email', (job, done) => {
      // send email for this;
      email(job.data.to, done);
    });
     
    app.kue.create('email', {
        title: 'welcome email for justin'
      , to: 'gdjyluxiaoyong@gmail.com'
      , template: 'welcome-email'
    }).save();

    License

    MIT

    Install

    npm i egg-kue

    DownloadsWeekly Downloads

    6

    Version

    0.1.2

    License

    MIT

    Last publish

    Collaborators

    • chandre