@@ -87,7 +87,7 @@ the extension) joined with `/` characters:
87
87
How the file is loaded as a task executor will depend on the specific file and
88
88
the plugins you have loaded.
89
89
90
- ## Loading JavaScript task executors
90
+ ## Loading JavaScript files
91
91
92
92
With the default preset, Graphile Worker will load ` .js ` , ` .cjs ` and ` .mjs `
93
93
files as task executors using the ` import() ` function. If the file is a CommonJS
@@ -100,7 +100,7 @@ at the source code of
100
100
[ ` LoadTaskFromJsPlugin.ts ` ] ( https://github.com/graphile/worker/blob/main/src/plugins/LoadTaskFromJsPlugin.ts )
101
101
for inspiration.
102
102
103
- ### Loading TypeScript task executors
103
+ ### Loading TypeScript files
104
104
105
105
::: tip
106
106
@@ -154,9 +154,9 @@ Worker will see this as success. All other exit codes are seen as failure.
154
154
### Environment variables
155
155
156
156
- ` GRAPHILE_WORKER_PAYLOAD_FORMAT ` &mdash ; the encoding that Graphile Worker
157
- used to pass the payload to the binary. Currently this will always be the
158
- string ` json ` , but you should check this before processing the payload in case
159
- the format changes.
157
+ used to pass the payload to the binary. Currently this will be the string
158
+ ` json ` , but you should check this before processing the payload in case the
159
+ format changes.
160
160
- ` GRAPHILE_WORKER_TASK_IDENTIFIER ` &mdash ; the identifier for the task this
161
161
file represents (useful if you want multiple task identifiers to be served by
162
162
the same binary file, e.g. via symlinks)
@@ -191,15 +191,19 @@ promises — i.e. the successful entries will be removed.
191
191
192
192
### ` helpers.abortPromise `
193
193
194
+ ** Experimental**
195
+
194
196
This is a promise that will reject when [ ` abortSignal ` ] ( #helpersabortsignal )
195
197
aborts. This makes it convenient for exiting your task when the abortSignal
196
198
fires: ` Promise.race([abortPromise, doYourAsyncThing()]) ` .
197
199
198
200
### ` helpers.abortSignal `
199
201
200
- This is a Node ` AbortSignal ` . Use this to be notified that you should abort your
201
- task early due to a graceful shutdown request. ` AbortSignal ` s can be passed to a
202
- number of asynchronous Node.js methods like
202
+ ** Experimental**
203
+
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
203
207
[ ` http.request() ` ] ( https://nodejs.org/api/http.html#httprequesturl-options-callback ) .
204
208
205
209
### ` helpers.addJob() `
@@ -212,17 +216,17 @@ See [`addJobs`](/library/add-job.md#add-jobs).
212
216
213
217
### ` helpers.getQueueName() `
214
218
215
- Get the name of the queue the job is in, or the queue name of the provided queue
216
- ID . This function may or may not return a promise. We recommend that you always
217
- ` await ` it.
219
+ Get the queue name of the given queue ID ( or of the currently executing job if
220
+ no queue ID is specified) . This function may or may not return a promise. We
221
+ recommend that you always ` await ` it.
218
222
219
223
### ` helpers.job `
220
224
221
- The whole job, including ` uuid ` , ` attempts ` , etc.
225
+ The whole, currently executing job, including ` uuid ` , ` attempts ` , etc.
222
226
223
227
### ` helpers.logger `
224
228
225
- See [ Logger] ( ./library/logger )
229
+ A logger instance scoped to this job. See [ Logger] ( ./library/logger )
226
230
227
231
### ` helpers.query() `
228
232
0 commit comments