kue-jobs

1.1.1 • Public • Published

kue-jobs

Kue job and process manager

Install

npm install kue-jobs --save

Usage

var jobs = require('kue-jobs');

Create a new job:

job.create('<job_name>',
  {
    title: '<job title>',
    name: 'foo',
  },
  {
    priority: 'normal',
    attempts: 3,
    onComplete: () => {
      // on complete
    },
    onFailed: () => {
      // on failed
    }
  }
);

Process job:

  jobs.process(<job_name>, 5, function* (job) {
 
    //do your magic
 
    if (every_thing_is_ok)
      return {'message': 'success'};
    else
      throw new Error('Job failed');
  });

Readme

Keywords

none

Package Sidebar

Install

npm i kue-jobs

Weekly Downloads

2

Version

1.1.1

License

MIT

Last publish

Collaborators

  • raminmousavi