bulkhead-kue
A Bulkhead plugin that easily integrates LearnBoost's Kue into a SailJS project.
Installation
npm install bulkhead-kue
Then, in the config/bootstrap.js
file of your SailsJS project directory, replace the default cb()
with:
plugins;
If you are using Bulkhead-Kue
with Bulkhead-Test, the suite has to be lifted like this:
var Suite = ;Suite;
Usage
To create new jobs in a queue, do the following:
var QueueService = ;QueueService;
NOTE:
If you create a new job on a queue that has not been created yet,
.create()
will create the queue as well.
To get access to the queue and it's Kue methods, do the following:
QueueService;
To find jobs by their processing state, the search criteria should be a string:
QueueService;
To find jobs by their ID, the search criteria should be a number:
QueueService;
To find jobs by complex criteria, the search criteria should be an object:
QueueService;
To process all jobs in a queue, do the following:
QueueService;
Read the official Kue documentation for more advanced usage.