egg-delayed-queue
A priority queue queue backed by redis, built for eggjs.
Install
$ yarn add egg-delayed-queue
Usage
// {app_root}/config/plugin.jsexportsqueue = enable: true package: 'egg-delayed-queue';
Configuration
// {app_root}/config/config.default.js'use strict';exportsqueue = 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.js 里面调用 如果需要用到ctx 可以 const ctx = app.createAnonymousContext();appqueue; // 在需要的地方订阅一个消息appqueue // 延时多少毫秒 ;
form more config please see here
Questions & Suggestions
Please open an issue here.