@@ -151,6 +151,11 @@ the file with the relevant environment variables and pass in the payload
151
151
according to the encoding. If the executable exits with code ` 0 ` then Graphile
152
152
Worker will see this as success. All other exit codes are seen as failure.
153
153
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
+
154
159
### Environment variables
155
160
156
161
- ` GRAPHILE_WORKER_PAYLOAD_FORMAT ` &mdash ; the encoding that Graphile Worker
@@ -201,9 +206,9 @@ fires: `Promise.race([abortPromise, doYourAsyncThing()])`.
201
206
202
207
** Experimental**
203
208
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
207
212
[ ` http.request() ` ] ( https://nodejs.org/api/http.html#httprequesturl-options-callback ) .
208
213
209
214
### ` helpers.addJob() `
@@ -236,9 +241,10 @@ This is a convenience wrapper for
236
241
237
242
### ` helpers.withPgClient() `
238
243
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 ` .
242
248
243
249
Example:
244
250
0 commit comments