File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ Read more:
39
39
output via logging (thanks @wineTGH ).
40
40
- Fix race condition when multiple workers attempt to initialise the database at
41
41
the same time
42
+ - ` helpers.abortSignal ` is no longer typed as ` | undefined ` . It is still
43
+ experimental!
44
+ - ` helpers.abortPromise ` added; will reject when ` abortSignal ` aborts (useful
45
+ for ` Promise.race() ` )
42
46
43
47
## v0.16.6
44
48
Original file line number Diff line number Diff line change @@ -36,9 +36,13 @@ Each task function is passed two arguments:
36
36
shouldn't need this
37
37
- ` getQueueName() ` &mdash ; get the name of the queue the job is in (may or may
38
38
not return a promise - recommend you always ` await ` it)
39
- - ` abortSignal ` &mdash ; could be an ` AbortSignal ` or ` undefined ` ; if set, use
40
- this to abort your task early on graceful shutdown (can be passed to a
41
- number of asynchronous Node.js methods)
39
+ - ` abortSignal ` &mdash ; could be an ` AbortSignal ` , or ` undefined ` if not
40
+ supported by this release of worker; if set, use this to abort your task
41
+ early on graceful shutdown (can be passed to a number of asynchronous
42
+ Node.js methods)
43
+ - ` abortPromise ` &mdash ; if present, a promise that will reject when
44
+ ` abortSignal ` aborts; convenient for exiting your task when the abortSignal
45
+ fires: ` Promise.race([abortPromise, doYourThing()]) `
42
46
- ` withPgClient ` &mdash ; a helper to use to get a database client
43
47
- ` query(sql, values) ` &mdash ; a convenience wrapper for
44
48
` withPgClient(pgClient => pgClient.query(sql, values)) `
You can’t perform that action at this time.
0 commit comments