JSPM

pg-boss

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 86071
  • Score
    100M100P100Q159729F
  • License MIT

Queueing jobs in Node.js using PostgreSQL like a boss

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.

PostgreSql Version npm Build Status Coverage Status

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