Git Product home page Git Product logo

egg-bullmq's Introduction

egg-bullmq

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

依赖说明

依赖的 egg 版本

egg-bullmq 版本 egg 1.x
1.x 😁
0.x

依赖的插件

开启插件

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

使用场景

  • 定时任务
  • 工作流

目录结构 &

.
├── app
│   ├── schedule
│   │   └── workflow.js
│   └── router.js

消费者

// /app/schedule/comsumer.js

module.exports = app => {
  return {
    schedule: {
      type: 'queue | workflow', // 扩展定时任务类型, 具体参考 [Egg.js Schedule](https://Quinton.org/zh-cn/basics/schedule.html#%E6%89%A9%E5%B1%95%E5%AE%9A%E6%97%B6%E4%BB%BB%E5%8A%A1%E7%B1%BB%E5%9E%8B)
      // below are self-defined args
      queue: 'speed_test',
      prefix: 'com.task.workflow',
      pattern: 'workflow',
    },
    // schedule 就是上面的 schedule
    async task(ctx, { schedule: { queueName }, msg, ackEvent }) {
      // do something stuff
    },
  };
};

详细配置

请到 config/config.default.js 查看详细配置项说明。

单元测试

提问交流

请到 egg issues 异步交流。

License

MIT

egg-bullmq's People

Contributors

tsui66 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.