Comparing version 0.3.0 to 0.3.1
@@ -37,3 +37,5 @@ 'use strict'; | ||
function archive() { | ||
return self.db.executeSql(self.archiveCommand, self.config.archiveCompletedJobsEvery); | ||
return self.db.executeSql(self.archiveCommand, self.config.archiveCompletedJobsEvery).then(function (result) { | ||
if (result.rowCount) self.emit('archived', result.rowCount); | ||
}); | ||
} | ||
@@ -40,0 +42,0 @@ |
@@ -51,3 +51,5 @@ 'use strict'; | ||
function expire() { | ||
return self.db.executeSql(self.expireJobCommand); | ||
return self.db.executeSql(self.expireJobCommand).then(function (result) { | ||
if (result.rowCount) self.emit('expired', result.rowCount); | ||
}); | ||
} | ||
@@ -54,0 +56,0 @@ |
{ | ||
"name": "pg-boss", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Queueing jobs in Node.js using PostgreSQL like a boss", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -23,3 +23,4 @@ Queueing jobs in Node.js using PostgreSQL like a boss. | ||
boss.subscribe('work', (job, done) => { | ||
console.log(`got job ${job.name} (${job.id}) ${JSON.stringify(job.data)}`); | ||
console.log(`received job ${job.name} (${job.id})`); | ||
console.log(JSON.stringify(job.data)); | ||
@@ -31,5 +32,6 @@ done().then(() => console.log('Confirmed done')); | ||
##Installation | ||
`$ npm install pg-boss` | ||
pg-boss is a message queue (aka job queue, task queue) built in Node.js on top of PostgreSQL in order to provide guaranteed messaging and asynchronous execution to your Node apps. | ||
Why would you consider using this queue over others? Well, I will say this is a crowded space in npm, and I haven't personally used very many of them, but if you're already using Node and Postgres, you could avoid a conversation with Ops. I wrote this to remove a dependency on Redis (via the kue package), consolidating systems I have to support in production and well as upgrading to guaranteed message processing. This will likely cater to anyone already familiar with the simplicity of relational database semantics and operations (querying and backups, for example) as well as a low budget solution to a very common problem. | ||
##Features | ||
@@ -49,5 +51,8 @@ * Guaranteed delivery and finalizing of jobs using a promise API | ||
##Installation | ||
`$ npm install pg-boss` | ||
##Documentation | ||
It's actually taking longer to document this than actually write it. :) | ||
* [API Docs](https://github.com/timgit/pg-boss/wiki/API-docs) - (in progress) | ||
* [API](https://github.com/timgit/pg-boss/wiki/api) | ||
* [Configuration](https://github.com/timgit/pg-boss/wiki/configuration) | ||
@@ -54,0 +59,0 @@ ##Background |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45043
698
63