Comparing version 9.0.1 to 9.0.2
{ | ||
"name": "pg-boss", | ||
"version": "9.0.1", | ||
"version": "9.0.2", | ||
"description": "Queueing jobs in Node.js using PostgreSQL like a boss", | ||
@@ -19,4 +19,3 @@ "main": "./src/index.js", | ||
"devDependencies": { | ||
"@types/node": "^18.0.0", | ||
"coveralls": "^3.1.0", | ||
"@types/node": "^20.3.3", | ||
"luxon": "^3.0.1", | ||
@@ -29,6 +28,3 @@ "mocha": "^10.0.0", | ||
"test": "standard && mocha", | ||
"cover": "nyc --reporter=text npm test", | ||
"travis-cover": "nyc --reporter=text npm run travis-test", | ||
"travis-test": "standard && mocha --jobs 0 --exit", | ||
"forcover": "npm run travis-cover && nyc report --reporter=text-lcov | coveralls", | ||
"cover": "nyc npm test", | ||
"export-schema": "node ./scripts/construct.js", | ||
@@ -52,3 +48,8 @@ "export-migration": "node ./scripts/migrate.js", | ||
"sourceMap": false, | ||
"instrument": true | ||
"instrument": true, | ||
"reporter": [ | ||
"lcov", | ||
"text-summary", | ||
"text" | ||
] | ||
}, | ||
@@ -61,2 +62,3 @@ "standard": { | ||
"after", | ||
"before", | ||
"beforeEach", | ||
@@ -63,0 +65,0 @@ "afterEach" |
@@ -5,3 +5,3 @@ Queueing jobs in Node.js using PostgreSQL like a boss. | ||
[![npm version](https://badge.fury.io/js/pg-boss.svg)](https://badge.fury.io/js/pg-boss) | ||
[![Build Status](https://app.travis-ci.com/timgit/pg-boss.svg?branch=master)](https://app.travis-ci.com/github/timgit/pg-boss) | ||
![Build](https://github.com/timgit/pg-boss/actions/workflows/ci.yml/badge.svg?branch=master) | ||
[![Coverage Status](https://coveralls.io/repos/github/timgit/pg-boss/badge.svg?branch=master)](https://coveralls.io/github/timgit/pg-boss?branch=master) | ||
@@ -37,3 +37,3 @@ | ||
pg-boss relies on [SKIP LOCKED](http://blog.2ndquadrant.com/what-is-select-skip-locked-for-in-postgresql-9-5), a feature added to postgres specifically for message queues, in order to resolve record locking challenges inherent with relational databases. This brings the safety of guaranteed atomic commits of a relational database to your asynchronous job processing. | ||
pg-boss relies on [SKIP LOCKED](https://www.2ndquadrant.com/en/blog/what-is-select-skip-locked-for-in-postgresql-9-5/), a feature added to postgres specifically for message queues, in order to resolve record locking challenges inherent with relational databases. This brings the safety of guaranteed atomic commits of a relational database to your asynchronous job processing. | ||
@@ -40,0 +40,0 @@ This will likely cater the most to teams already familiar with the simplicity of relational database semantics and operations (SQL, querying, and backups). It will be especially useful to those already relying on PostgreSQL that want to limit how many systems are required to monitor and support in their architecture. |
@@ -97,4 +97,2 @@ const EventEmitter = require('events') | ||
this.stopped = false | ||
if (this.db.isOurs && !this.db.opened) { | ||
@@ -106,2 +104,3 @@ await this.db.open() | ||
this.stopped = false | ||
this.started = true | ||
@@ -108,0 +107,0 @@ |
@@ -110,12 +110,19 @@ import { EventEmitter } from 'events' | ||
interface JobFetchOptions { | ||
interface CommonJobFetchOptions { | ||
includeMetadata?: boolean; | ||
enforceSingletonQueueActiveLimit?: boolean; | ||
} | ||
type JobFetchOptions = CommonJobFetchOptions & { | ||
teamSize?: number; | ||
teamConcurrency?: number; | ||
teamRefill?: boolean; | ||
batchSize?: number; | ||
includeMetadata?: boolean; | ||
enforceSingletonQueueActiveLimit?: boolean; | ||
} | ||
type BatchJobFetchOptions = CommonJobFetchOptions & { | ||
batchSize: number; | ||
} | ||
type WorkOptions = JobFetchOptions & JobPollingOptions | ||
type BatchWorkOptions = BatchJobFetchOptions & JobPollingOptions | ||
@@ -128,9 +135,17 @@ type FetchOptions = { | ||
interface WorkHandler<ReqData> { | ||
(job: PgBoss.Job<ReqData>): Promise<void>; | ||
(job: PgBoss.Job<ReqData>): Promise<any>; | ||
} | ||
interface BatchWorkHandler<ReqData> { | ||
(job: PgBoss.Job<ReqData>[]): Promise<any>; | ||
} | ||
interface WorkWithMetadataHandler<ReqData> { | ||
(job: PgBoss.JobWithMetadata<ReqData>): Promise<void>; | ||
(job: PgBoss.JobWithMetadata<ReqData>): Promise<any>; | ||
} | ||
interface BatchWorkWithMetadataHandler<ReqData> { | ||
(job: PgBoss.JobWithMetadata<ReqData>[]): Promise<any>; | ||
} | ||
interface Request { | ||
@@ -307,2 +322,5 @@ name: string; | ||
work<ReqData>(name: string, options: PgBoss.BatchWorkOptions & { includeMetadata: true }, handler: PgBoss.BatchWorkWithMetadataHandler<ReqData>): Promise<string>; | ||
work<ReqData>(name: string, options: PgBoss.BatchWorkOptions, handler: PgBoss.BatchWorkHandler<ReqData>): Promise<string>; | ||
onComplete(name: string, handler: Function): Promise<string>; | ||
@@ -309,0 +327,0 @@ onComplete(name: string, options: PgBoss.WorkOptions, handler: Function): Promise<string>; |
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
554932
5
34
3147