3.4.0 • Published 10 months ago

@edy/sails-hook-resque v3.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

sails-hook-resque

Build Status

Delayed tasks in Sails.js app. Using node-resque

Configuration

All configuration options are available in lib/defaults.js

Queue usage

Hook setup queue service in your Sails.js application

Your Sails.js application will contain sails.resque.queue object that is NR.queue and have all it's methods.

Usage in application In your application:

Create a task in api/jobs/add.js :

module.exports = {
  plugins: [ 'JobLock' ],
  pluginOptions: {
    jobLock: {},
  },
  perform: async (a, b) => {
    const answer = a + b;
    await new Promise((r) => setTimeout(r, 1000));
    return answer;
  },
};

And queue it in your application:

sails.resque.queue.enqueue('math', 'add', [1, 2]);
3.4.0

10 months ago

3.3.1

1 year ago

3.3.0

1 year ago

3.2.2

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

7 years ago