项目作者: biebg

项目描述 :
egg-plugin bull for egg framework
高级语言: JavaScript
项目地址: git://github.com/biebg/egg-bull.git
创建时间: 2017-10-28T12:13:05Z
项目社区:https://github.com/biebg/egg-bull

开源协议:MIT License

下载


egg-bull

NPM version
build status
Test coverage
David deps
Known Vulnerabilities
npm download

bull plugin for egg framework

Install

  1. $ npm i egg-bull --save

Usage

  1. // {app_root}/config/plugin.js
  2. exports.bull = {
  3. enable: true,
  4. package: 'egg-bull',
  5. };

Configuration

  1. // {app_root}/config/config.unittest.js
  2. exports.bull = {
  3. default: {
  4. redis: {
  5. host: '127.0.0.1',
  6. port: 6379,
  7. }
  8. },
  9. clients: {
  10. TestQueue: {topic: 'test'},
  11. },
  12. app: true,
  13. agent: false
  14. };

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

Example

  1. app.bull.get('TestQueue').add({ message: 'hi bull' });
  2. app.bull.get('TestQueue').process(function(job) {
  3. assert(job.data.message === 'hi bull');
  4. done();
  5. });

see bull home page for more details

Questions & Suggestions

Please open an issue here.

License

MIT