pg-boss 10.0.0-beta20 → 10.0.0-beta21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,20 +27,21 @@ async function readme() {
27
27
 
28
28
  pg-boss is a job queue built in Node.js on top of PostgreSQL in order to provide background processing and reliable asynchronous execution to Node.js applications.
29
29
 
30
- 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 to resolve record locking challenges inherent with relational databases. This provides exactly-once delivery, and the safety of guaranteed atomic commits of a relational database to asynchronous job processing.
30
+ pg-boss relies on [SKIP LOCKED](https://www.2ndquadrant.com/en/blog/what-is-select-skip-locked-for-in-postgresql-9-5/), a feature built specifically for message queues to resolve record locking challenges inherent with relational databases. This provides exactly-once delivery and the safety of guaranteed atomic commits to asynchronous job processing.
31
31
 
32
32
  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.
33
33
 
34
34
 
35
- ## Features
35
+ ## Summary
36
36
  * Exactly-once job delivery
37
37
  * Backpressure-compatible polling workers
38
38
  * Cron scheduling
39
+ * Queue storage policies to support a variety of rate limiting, debouncing, and concurrency use cases
40
+ * Priority queues, dead letter queues, job deferral, automatic retries with exponential backoff
39
41
  * Pub/sub API for fan-out queue relationships
40
- * Priority queues, deferral, retries (with exponential backoff), rate limiting, debouncing
41
- * Table operations via SQL for bulk loads via COPY or INSERT
42
+ * Raw SQL support for non-Node.js runtimes via INSERT or COPY
43
+ * Serverless function compatible
42
44
  * Multi-master compatible (for example, in a Kubernetes ReplicaSet)
43
- * Dead letter queues
44
45
 
45
46
  ## Requirements
46
47
  * Node 20 or higher
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-boss",
3
- "version": "10.0.0-beta20",
3
+ "version": "10.0.0-beta21",
4
4
  "description": "Queueing jobs in Postgres from Node.js like a boss",
5
5
  "main": "./src/index.js",
6
6
  "engines": {
package/src/index.js CHANGED
@@ -149,7 +149,7 @@ class PgBoss extends EventEmitter {
149
149
  return
150
150
  }
151
151
 
152
- let { destroy = false, graceful = true, timeout = 30000, wait = true } = options
152
+ let { close = true, graceful = true, timeout = 30000, wait = true } = options
153
153
 
154
154
  timeout = Math.max(timeout, 1000)
155
155
 
@@ -168,7 +168,7 @@ class PgBoss extends EventEmitter {
168
168
 
169
169
  await this.#manager.failWip()
170
170
 
171
- if (this.#db.isOurs && this.#db.opened && destroy) {
171
+ if (this.#db.isOurs && this.#db.opened && close) {
172
172
  await this.#db.close()
173
173
  }
174
174
 
package/src/plans.js CHANGED
@@ -400,7 +400,7 @@ function getQueues (schema) {
400
400
  dead_letter as "deadLetter",
401
401
  created_on as "createdOn",
402
402
  updated_on as "updatedOn"
403
- FROM ${schema}.queue
403
+ FROM ${schema}.queue
404
404
  `
405
405
  }
406
406
 
package/types.d.ts CHANGED
@@ -242,7 +242,7 @@ declare namespace PgBoss {
242
242
  }
243
243
 
244
244
  interface StopOptions {
245
- destroy?: boolean,
245
+ close?: boolean,
246
246
  graceful?: boolean,
247
247
  timeout?: number,
248
248
  wait?: boolean
@@ -343,15 +343,15 @@ declare class PgBoss extends EventEmitter {
343
343
  fail(name: string, id: string, data: object, options?: PgBoss.ConnectionOptions): Promise<void>;
344
344
  fail(name: string, ids: string[], options?: PgBoss.ConnectionOptions): Promise<void>;
345
345
 
346
- getQueueSize(name: string, options?: object): Promise<number>;
347
346
  getJobById(name: string, id: string, options?: PgBoss.ConnectionOptions & { includeArchive: bool }): Promise<PgBoss.JobWithMetadata | null>;
348
-
347
+
349
348
  createQueue(name: string, options?: PgBoss.Queue): Promise<void>;
350
- getQueue(name: string): Promise<PgBoss.Queue | null>;
351
- getQueues(): Promise<PgBoss.QueueResult[]>;
352
349
  updateQueue(name: string, options?: PgBoss.Queue): Promise<void>;
353
350
  deleteQueue(name: string): Promise<void>;
354
351
  purgeQueue(name: string): Promise<void>;
352
+ getQueues(): Promise<PgBoss.QueueResult[]>;
353
+ getQueue(name: string): Promise<PgBoss.QueueResult | null>;
354
+ getQueueSize(name: string, options?: { before: 'retry' | 'active' | 'completed' | 'cancelled' | 'failed' }): Promise<number>;
355
355
 
356
356
  clearStorage(): Promise<void>;
357
357
  archive(): Promise<void>;