Package Exports
- pg-boss
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pg-boss) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Queueing jobs in Node.js using PostgreSQL like a boss.
var PgBoss = require('pg-boss');
var boss = new PgBoss('postgres://username:password@localhost/database');
boss.on('error', error);
boss.on('ready', ready);
boss.start();
function ready() {
boss.publish('work', {message: 'stuff'})
.then(function(jobId){
console.log('created job ' + jobId);
});
boss.subscribe('work', null, function(data, done) {
console.log('received work job with payload ' + data.message);
done().then(function() {
console.log('Confirmed done');
});
});
}
function error(err){
console.error(err);
}##Installation
$ npm install pg-boss