Skip to content

Commit 1cf6a17

Browse files
committed
PR feedback plus a couple more tweaks
1 parent 13abc1e commit 1cf6a17

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ export interface JobHelpers extends Helpers {
181181
): Promise<QueryResult<R>>;
182182

183183
/**
184-
* A Node `AbortSignal` that will be triggered when the job should exit. It is
185-
* used, for example, for a graceful shutdown request.
184+
* An `AbortSignal` that will be triggered when the job should exit. It is used,
185+
* for example, for a graceful shutdown request.
186186
*
187187
* @experimental
188188
*/

website/docs/tasks.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ the file with the relevant environment variables and pass in the payload
151151
according to the encoding. If the executable exits with code `0` then Graphile
152152
Worker will see this as success. All other exit codes are seen as failure.
153153

154+
This feature is added via the
155+
[LoadTaskFromExecutableFilePlugin plugin](https://github.com/graphile/worker/blob/main/src/plugins/LoadTaskFromExecutableFilePlugin.ts)
156+
in the default
157+
[Worker Preset](https://github.com/graphile/worker/blob/main/src/preset.ts).
158+
154159
### Environment variables
155160

156161
- `GRAPHILE_WORKER_PAYLOAD_FORMAT` &mdash; the encoding that Graphile Worker
@@ -201,9 +206,9 @@ fires: `Promise.race([abortPromise, doYourAsyncThing()])`.
201206

202207
**Experimental**
203208

204-
This is a Node `AbortSignal` that will be triggered when the job should exit
205-
early. It is used, for example, for a graceful shutdown request. `AbortSignal`s
206-
can be passed to a number of asynchronous Node.js methods like
209+
This is a `AbortSignal` that will be triggered when the job should exit early.
210+
It is used, for example, for a graceful shutdown request. `AbortSignal`s can be
211+
passed to a number of asynchronous Node.js methods like
207212
[`http.request()`](https://nodejs.org/api/http.html#httprequesturl-options-callback).
208213

209214
### `helpers.addJob()`
@@ -236,9 +241,10 @@ This is a convenience wrapper for
236241

237242
### `helpers.withPgClient()`
238243

239-
`withPgClient` gets a `pgClient` from the pool, calls
240-
`await callback(pgClient)`, and finally releases the client and returns the
241-
result of `callback`. This workflow can make testing your tasks easier.
244+
`withPgClient` gets a `pgClient` from the pool that Graphile Worker uses. It
245+
calls `await callback(pgClient)`, and finally releases the client and returns
246+
the result of `callback`. This workflow can make testing your tasks easier by
247+
making it easier to mock `pgClient`.
242248

243249
Example:
244250

0 commit comments

Comments
 (0)