Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

egg-kue-jobs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-kue-jobs

kue plugin for egg

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

egg-kue-jobs

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

Install

$ npm i egg-kue-jobs --save

Usage

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

Configuration

// {app_root}/config/config.default.js
exports.kueJobs = {
  app: true,
  agent: false,
  client: {
    listen: 3001,
    queue: {
      prefix: 'q',
      redis: 'redis://localhost:6379/0'
    },
    jobDir: path.join(appInfo.baseDir, 'app/job/kue'),
    jobConfig: [{
      type: 'helloWorld',
    }],
  },
};

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

Example

// app/job/kue/hello-world.js
'use strict';

module.exports = app => {

  return {
    config: null,
    initConfig: config => {
      this.config = config;
    },
    registerConsumer: async kueQueue => {
      console.log(app);
      console.log(kueQueue);
      console.log('registerConsumer');
    },
    produce: async msg => {
      const ctx = app.createAnonymousContext();
      const kueQueue = app.kue.queue;
      console.log(ctx);
      console.log(msg);
      console.log(kueQueue);
      console.log(this.config);
      console.log('produce');
    },
  };
};

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

FAQs

Package last updated on 27 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc