Skip to content

Commit

Permalink
Add to release notes and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Nov 22, 2024
1 parent 923c6aa commit 49b7266
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Read more:
output via logging (thanks @wineTGH).
- Fix race condition when multiple workers attempt to initialise the database at
the same time
- `helpers.abortSignal` is no longer typed as `| undefined`. It is still
experimental!
- `helpers.abortPromise` added; will reject when `abortSignal` aborts (useful
for `Promise.race()`)

## v0.16.6

Expand Down
10 changes: 7 additions & 3 deletions website/docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ Each task function is passed two arguments:
shouldn't need this
- `getQueueName()` — get the name of the queue the job is in (may or may
not return a promise - recommend you always `await` it)
- `abortSignal` — could be an `AbortSignal` or `undefined`; if set, use
this to abort your task early on graceful shutdown (can be passed to a
number of asynchronous Node.js methods)
- `abortSignal` — could be an `AbortSignal`, or `undefined` if not
supported by this release of worker; if set, use this to abort your task
early on graceful shutdown (can be passed to a number of asynchronous
Node.js methods)
- `abortPromise` — if present, a promise that will reject when
`abortSignal` aborts; convenient for exiting your task when the abortSignal
fires: `Promise.race([abortPromise, doYourThing()])`
- `withPgClient` — a helper to use to get a database client
- `query(sql, values)` — a convenience wrapper for
`withPgClient(pgClient => pgClient.query(sql, values))`
Expand Down

0 comments on commit 49b7266

Please sign in to comment.