@holo-js/queue 0.3.27 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/.holo-build-fingerprint +1 -0
- package/dist/{chunk-5MPOVBVE.mjs → chunk-CYZWPHVL.mjs} +231 -8
- package/dist/{config-Bleufve4.d.ts → config-Cztv8leT.d.ts} +21 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +3 -1
- package/dist/index.d.ts +29 -12
- package/dist/index.mjs +217 -240
- package/package.json +24 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Holo-JS contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b3ff4bfb2397046e791968a87d26b1663356144526c9d5ea746331426f2cb103
|
|
@@ -1,3 +1,190 @@
|
|
|
1
|
+
// src/contracts.ts
|
|
2
|
+
var QUEUE_TIMER_MAX_SECONDS = Math.floor((2 ** 31 - 1) / 1e3);
|
|
3
|
+
function getQueueJobDispatcher() {
|
|
4
|
+
return globalThis.__holoQueueJobDispatcher__;
|
|
5
|
+
}
|
|
6
|
+
function setQueueJobDispatcher(dispatcher) {
|
|
7
|
+
const runtime = globalThis;
|
|
8
|
+
runtime.__holoQueueJobDispatcher__ = dispatcher;
|
|
9
|
+
}
|
|
10
|
+
function getQueueJobSyncDispatcher() {
|
|
11
|
+
return globalThis.__holoQueueJobSyncDispatcher__;
|
|
12
|
+
}
|
|
13
|
+
function setQueueJobSyncDispatcher(dispatcher) {
|
|
14
|
+
const runtime = globalThis;
|
|
15
|
+
runtime.__holoQueueJobSyncDispatcher__ = dispatcher;
|
|
16
|
+
}
|
|
17
|
+
function getQueueJobDefinitionNames() {
|
|
18
|
+
const runtime = globalThis;
|
|
19
|
+
runtime.__holoQueueJobDefinitionNames__ ??= /* @__PURE__ */ new WeakMap();
|
|
20
|
+
return runtime.__holoQueueJobDefinitionNames__;
|
|
21
|
+
}
|
|
22
|
+
function getQueueJobDefinitionsByName() {
|
|
23
|
+
const runtime = globalThis;
|
|
24
|
+
runtime.__holoQueueJobDefinitionsByName__ ??= /* @__PURE__ */ new Map();
|
|
25
|
+
return runtime.__holoQueueJobDefinitionsByName__;
|
|
26
|
+
}
|
|
27
|
+
function setQueueJobDefinitionName(definition, name) {
|
|
28
|
+
getQueueJobDefinitionNames().set(definition, name);
|
|
29
|
+
const definitions = getQueueJobDefinitionsByName().get(name) ?? /* @__PURE__ */ new Set();
|
|
30
|
+
definitions.add(definition);
|
|
31
|
+
getQueueJobDefinitionsByName().set(name, definitions);
|
|
32
|
+
}
|
|
33
|
+
function deleteQueueJobDefinitionName(name) {
|
|
34
|
+
const definitions = getQueueJobDefinitionsByName().get(name);
|
|
35
|
+
for (const definition of definitions ?? []) {
|
|
36
|
+
if (getQueueJobDefinitionNames().get(definition) === name) {
|
|
37
|
+
getQueueJobDefinitionNames().delete(definition);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
getQueueJobDefinitionsByName().delete(name);
|
|
41
|
+
}
|
|
42
|
+
function clearQueueJobDefinitionNames() {
|
|
43
|
+
for (const name of getQueueJobDefinitionsByName().keys()) {
|
|
44
|
+
deleteQueueJobDefinitionName(name);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function resolveQueueJobDefinitionName(definition) {
|
|
48
|
+
const name = getQueueJobDefinitionNames().get(definition);
|
|
49
|
+
if (name) {
|
|
50
|
+
return name;
|
|
51
|
+
}
|
|
52
|
+
throw new Error("[Holo Queue] Job definitions cannot dispatch before the job is registered.");
|
|
53
|
+
}
|
|
54
|
+
function dispatchDefinedQueueJob(definition, payload) {
|
|
55
|
+
const dispatcher = getQueueJobDispatcher();
|
|
56
|
+
if (!dispatcher) {
|
|
57
|
+
throw new Error("[Holo Queue] Job definitions cannot dispatch before the queue runtime is loaded.");
|
|
58
|
+
}
|
|
59
|
+
return dispatcher(resolveQueueJobDefinitionName(definition), payload);
|
|
60
|
+
}
|
|
61
|
+
function dispatchDefinedQueueJobSync(definition, payload) {
|
|
62
|
+
const dispatcher = getQueueJobSyncDispatcher();
|
|
63
|
+
if (!dispatcher) {
|
|
64
|
+
throw new Error("[Holo Queue] Job definitions cannot dispatch before the queue runtime is loaded.");
|
|
65
|
+
}
|
|
66
|
+
return dispatcher(resolveQueueJobDefinitionName(definition), payload);
|
|
67
|
+
}
|
|
68
|
+
function normalizeOptionalString(value, label) {
|
|
69
|
+
if (typeof value === "undefined") {
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
72
|
+
const normalized = value.trim();
|
|
73
|
+
if (!normalized) {
|
|
74
|
+
throw new Error(`[Holo Queue] ${label} must be a non-empty string when provided.`);
|
|
75
|
+
}
|
|
76
|
+
return normalized;
|
|
77
|
+
}
|
|
78
|
+
function normalizeOptionalInteger(value, label, options = {}) {
|
|
79
|
+
if (typeof value === "undefined") {
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
if (!Number.isInteger(value)) {
|
|
83
|
+
throw new Error(`[Holo Queue] ${label} must be an integer when provided.`);
|
|
84
|
+
}
|
|
85
|
+
if (typeof options.minimum === "number" && value < options.minimum) {
|
|
86
|
+
throw new Error(`[Holo Queue] ${label} must be greater than or equal to ${options.minimum}.`);
|
|
87
|
+
}
|
|
88
|
+
if (typeof options.maximum === "number" && value > options.maximum) {
|
|
89
|
+
throw new Error(`[Holo Queue] ${label} must be less than or equal to ${options.maximum}.`);
|
|
90
|
+
}
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
function normalizeOptionalBoolean(value, label) {
|
|
94
|
+
if (typeof value === "undefined") {
|
|
95
|
+
return void 0;
|
|
96
|
+
}
|
|
97
|
+
if (typeof value !== "boolean") {
|
|
98
|
+
throw new Error(`[Holo Queue] ${label} must be a boolean when provided.`);
|
|
99
|
+
}
|
|
100
|
+
return value;
|
|
101
|
+
}
|
|
102
|
+
function normalizeBackoff(value) {
|
|
103
|
+
if (typeof value === "undefined") {
|
|
104
|
+
return void 0;
|
|
105
|
+
}
|
|
106
|
+
if (typeof value === "number") {
|
|
107
|
+
return normalizeOptionalInteger(value, "Job backoff", { minimum: 0 });
|
|
108
|
+
}
|
|
109
|
+
if (!Array.isArray(value)) {
|
|
110
|
+
throw new Error("[Holo Queue] Job backoff must be a number or an array of integers.");
|
|
111
|
+
}
|
|
112
|
+
const normalized = value.map((entry, index) => {
|
|
113
|
+
if (!Number.isInteger(entry)) {
|
|
114
|
+
throw new Error(`[Holo Queue] Job backoff entry at index ${index} must be an integer.`);
|
|
115
|
+
}
|
|
116
|
+
if (entry < 0) {
|
|
117
|
+
throw new Error(`[Holo Queue] Job backoff entry at index ${index} must be greater than or equal to 0.`);
|
|
118
|
+
}
|
|
119
|
+
return entry;
|
|
120
|
+
});
|
|
121
|
+
return Object.freeze(normalized);
|
|
122
|
+
}
|
|
123
|
+
function normalizeOptionalHook(value, label) {
|
|
124
|
+
if (typeof value === "undefined") {
|
|
125
|
+
return void 0;
|
|
126
|
+
}
|
|
127
|
+
if (typeof value !== "function") {
|
|
128
|
+
throw new Error(`[Holo Queue] ${label} must be a function when provided.`);
|
|
129
|
+
}
|
|
130
|
+
return value;
|
|
131
|
+
}
|
|
132
|
+
function isQueueJobDefinition(value) {
|
|
133
|
+
return value !== null && typeof value === "object" && "handle" in value && typeof value.handle === "function";
|
|
134
|
+
}
|
|
135
|
+
function normalizeQueueJobDefinition(job) {
|
|
136
|
+
if (!isQueueJobDefinition(job)) {
|
|
137
|
+
throw new Error('[Holo Queue] Jobs must define a "handle" function.');
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
...job,
|
|
141
|
+
...typeof job.connection === "undefined" ? {} : { connection: normalizeOptionalString(job.connection, "Job connection") },
|
|
142
|
+
...typeof job.queue === "undefined" ? {} : { queue: normalizeOptionalString(job.queue, "Job queue") },
|
|
143
|
+
...typeof job.tries === "undefined" ? {} : { tries: normalizeOptionalInteger(job.tries, "Job tries", { minimum: 1 }) },
|
|
144
|
+
...typeof job.timeout === "undefined" ? {} : { timeout: normalizeOptionalInteger(job.timeout, "Job timeout", { minimum: 0, maximum: QUEUE_TIMER_MAX_SECONDS }) },
|
|
145
|
+
...typeof job.failOnTimeout === "undefined" ? {} : { failOnTimeout: normalizeOptionalBoolean(job.failOnTimeout, "Job failOnTimeout") },
|
|
146
|
+
...typeof job.backoff === "undefined" ? {} : { backoff: normalizeBackoff(job.backoff) },
|
|
147
|
+
...typeof job.onCompleted === "undefined" ? {} : { onCompleted: normalizeOptionalHook(job.onCompleted, "Job onCompleted hook") },
|
|
148
|
+
...typeof job.onFailed === "undefined" ? {} : { onFailed: normalizeOptionalHook(job.onFailed, "Job onFailed hook") }
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function defineJob(job) {
|
|
152
|
+
const normalized = normalizeQueueJobDefinition(job);
|
|
153
|
+
const registeredName = getQueueJobDefinitionNames().get(job);
|
|
154
|
+
if (registeredName) {
|
|
155
|
+
setQueueJobDefinitionName(normalized, registeredName);
|
|
156
|
+
}
|
|
157
|
+
Object.defineProperty(normalized, "dispatch", {
|
|
158
|
+
value(payload) {
|
|
159
|
+
return dispatchDefinedQueueJob(normalized, payload);
|
|
160
|
+
},
|
|
161
|
+
enumerable: false
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(normalized, "dispatchSync", {
|
|
164
|
+
value(payload) {
|
|
165
|
+
return dispatchDefinedQueueJobSync(normalized, payload);
|
|
166
|
+
},
|
|
167
|
+
enumerable: false
|
|
168
|
+
});
|
|
169
|
+
return Object.freeze(normalized);
|
|
170
|
+
}
|
|
171
|
+
var queueJobInternals = {
|
|
172
|
+
clearQueueJobDefinitionNames,
|
|
173
|
+
deleteQueueJobDefinitionName,
|
|
174
|
+
dispatchDefinedQueueJob,
|
|
175
|
+
dispatchDefinedQueueJobSync,
|
|
176
|
+
normalizeQueueJobDefinition,
|
|
177
|
+
normalizeBackoff,
|
|
178
|
+
normalizeOptionalHook,
|
|
179
|
+
normalizeOptionalBoolean,
|
|
180
|
+
normalizeOptionalInteger,
|
|
181
|
+
normalizeOptionalString,
|
|
182
|
+
resolveQueueJobDefinitionName,
|
|
183
|
+
setQueueJobDefinitionName,
|
|
184
|
+
setQueueJobDispatcher,
|
|
185
|
+
setQueueJobSyncDispatcher
|
|
186
|
+
};
|
|
187
|
+
|
|
1
188
|
// src/config.ts
|
|
2
189
|
import { registerConfigNormalizer } from "@holo-js/config/registry";
|
|
3
190
|
var DEFAULT_QUEUE_CONNECTION = "sync";
|
|
@@ -22,7 +209,8 @@ var DEFAULT_QUEUE_CONFIG = Object.freeze({
|
|
|
22
209
|
[DEFAULT_QUEUE_CONNECTION]: Object.freeze({
|
|
23
210
|
name: DEFAULT_QUEUE_CONNECTION,
|
|
24
211
|
driver: "sync",
|
|
25
|
-
queue: DEFAULT_QUEUE_NAME
|
|
212
|
+
queue: DEFAULT_QUEUE_NAME,
|
|
213
|
+
afterCommit: false
|
|
26
214
|
})
|
|
27
215
|
})
|
|
28
216
|
});
|
|
@@ -41,6 +229,9 @@ function parseInteger(value, fallback, label, options = {}) {
|
|
|
41
229
|
if (typeof options.minimum === "number" && integer < options.minimum) {
|
|
42
230
|
throw new Error(`[Holo Queue] ${label} must be greater than or equal to ${options.minimum}.`);
|
|
43
231
|
}
|
|
232
|
+
if (typeof options.maximum === "number" && integer > options.maximum) {
|
|
233
|
+
throw new Error(`[Holo Queue] ${label} must be less than or equal to ${options.maximum}.`);
|
|
234
|
+
}
|
|
44
235
|
return integer;
|
|
45
236
|
}
|
|
46
237
|
function normalizeConnectionName(value, label) {
|
|
@@ -56,11 +247,32 @@ function normalizeQueueName(value) {
|
|
|
56
247
|
function normalizeOptionalRedisString(value) {
|
|
57
248
|
return value?.trim() || void 0;
|
|
58
249
|
}
|
|
250
|
+
function assertQueueTimeoutBelowRetryAfter(subject, timeoutSeconds, connection) {
|
|
251
|
+
if (typeof timeoutSeconds !== "number" || !("retryAfter" in connection) || typeof connection.retryAfter !== "number") {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (timeoutSeconds < connection.retryAfter) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
throw new Error(
|
|
258
|
+
`[Holo Queue] ${subject} timeout of ${timeoutSeconds} seconds must be less than connection "${connection.name}" retryAfter of ${connection.retryAfter} seconds.`
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
function normalizeConnectionAfterCommit(name, value) {
|
|
262
|
+
if (typeof value === "undefined") {
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
if (typeof value !== "boolean") {
|
|
266
|
+
throw new Error(`[Holo Queue] queue connection "${name}" afterCommit must be a boolean.`);
|
|
267
|
+
}
|
|
268
|
+
return value;
|
|
269
|
+
}
|
|
59
270
|
function normalizeSyncConnection(name, config) {
|
|
60
271
|
return Object.freeze({
|
|
61
272
|
name,
|
|
62
273
|
driver: "sync",
|
|
63
|
-
queue: normalizeQueueName(config.queue)
|
|
274
|
+
queue: normalizeQueueName(config.queue),
|
|
275
|
+
afterCommit: normalizeConnectionAfterCommit(name, config.afterCommit)
|
|
64
276
|
});
|
|
65
277
|
}
|
|
66
278
|
function resolveSharedRedisConnection(redisConfig, connectionName) {
|
|
@@ -81,7 +293,7 @@ function parseRedisDatabaseFromUrl(url, label) {
|
|
|
81
293
|
try {
|
|
82
294
|
parsed = new URL(url);
|
|
83
295
|
} catch (error) {
|
|
84
|
-
throw new Error(`[Holo Queue] ${label} is invalid: ${String(error)}
|
|
296
|
+
throw new Error(`[Holo Queue] ${label} is invalid: ${String(error)}`, { cause: error });
|
|
85
297
|
}
|
|
86
298
|
if (parsed.protocol !== "redis:" && parsed.protocol !== "rediss:") {
|
|
87
299
|
throw new Error(`[Holo Queue] ${label} is invalid: unsupported protocol "${parsed.protocol}".`);
|
|
@@ -160,8 +372,10 @@ function normalizeRedisConnection(name, config, redisConfig) {
|
|
|
160
372
|
driver: "redis",
|
|
161
373
|
connection: resolvedRedisConnection?.name ?? connectionName ?? name,
|
|
162
374
|
queue: normalizeQueueName(config.queue),
|
|
375
|
+
afterCommit: normalizeConnectionAfterCommit(name, config.afterCommit),
|
|
163
376
|
retryAfter: parseInteger(config.retryAfter, DEFAULT_QUEUE_RETRY_AFTER, `queue connection "${name}" retryAfter`, {
|
|
164
|
-
minimum:
|
|
377
|
+
minimum: 1,
|
|
378
|
+
maximum: QUEUE_TIMER_MAX_SECONDS
|
|
165
379
|
}),
|
|
166
380
|
blockFor: parseInteger(config.blockFor, DEFAULT_QUEUE_BLOCK_FOR, `queue connection "${name}" blockFor`, {
|
|
167
381
|
minimum: 0
|
|
@@ -174,23 +388,26 @@ function normalizeDatabaseConnection(name, config) {
|
|
|
174
388
|
name,
|
|
175
389
|
driver: "database",
|
|
176
390
|
queue: normalizeQueueName(config.queue),
|
|
391
|
+
afterCommit: normalizeConnectionAfterCommit(name, config.afterCommit),
|
|
177
392
|
retryAfter: parseInteger(config.retryAfter, DEFAULT_QUEUE_RETRY_AFTER, `queue connection "${name}" retryAfter`, {
|
|
178
|
-
minimum:
|
|
393
|
+
minimum: 1
|
|
179
394
|
}),
|
|
180
395
|
sleep: parseInteger(config.sleep, DEFAULT_QUEUE_SLEEP, `queue connection "${name}" sleep`, {
|
|
181
|
-
minimum: 0
|
|
396
|
+
minimum: 0,
|
|
397
|
+
maximum: QUEUE_TIMER_MAX_SECONDS
|
|
182
398
|
}),
|
|
183
399
|
connection: config.connection?.trim() || DEFAULT_FAILED_JOBS_CONNECTION,
|
|
184
400
|
table: config.table?.trim() || DEFAULT_DATABASE_QUEUE_TABLE
|
|
185
401
|
});
|
|
186
402
|
}
|
|
187
403
|
function normalizePluginConnection(name, config) {
|
|
188
|
-
const { driver, queue, ...options } = config;
|
|
404
|
+
const { driver, queue, afterCommit, ...options } = config;
|
|
189
405
|
return Object.freeze({
|
|
190
406
|
...options,
|
|
191
407
|
name,
|
|
192
408
|
driver: normalizeConnectionName(driver, `queue connection "${name}" driver`),
|
|
193
|
-
queue: normalizeQueueName(queue)
|
|
409
|
+
queue: normalizeQueueName(queue),
|
|
410
|
+
afterCommit: normalizeConnectionAfterCommit(name, afterCommit)
|
|
194
411
|
});
|
|
195
412
|
}
|
|
196
413
|
function normalizeConnectionConfig(name, config, redisConfig) {
|
|
@@ -257,6 +474,11 @@ registerConfigNormalizer({
|
|
|
257
474
|
});
|
|
258
475
|
|
|
259
476
|
export {
|
|
477
|
+
QUEUE_TIMER_MAX_SECONDS,
|
|
478
|
+
isQueueJobDefinition,
|
|
479
|
+
normalizeQueueJobDefinition,
|
|
480
|
+
defineJob,
|
|
481
|
+
queueJobInternals,
|
|
260
482
|
DEFAULT_QUEUE_CONNECTION,
|
|
261
483
|
DEFAULT_QUEUE_NAME,
|
|
262
484
|
DEFAULT_QUEUE_RETRY_AFTER,
|
|
@@ -268,6 +490,7 @@ export {
|
|
|
268
490
|
DEFAULT_REDIS_HOST,
|
|
269
491
|
DEFAULT_REDIS_PORT,
|
|
270
492
|
DEFAULT_REDIS_DB,
|
|
493
|
+
assertQueueTimeoutBelowRetryAfter,
|
|
271
494
|
normalizeQueueConfig,
|
|
272
495
|
holoQueueDefaults,
|
|
273
496
|
queueInternals
|
|
@@ -15,7 +15,9 @@ declare function dispatchDefinedQueueJobSync<TPayload extends QueueJsonValue, TR
|
|
|
15
15
|
declare function normalizeOptionalString(value: string | undefined, label: string): string | undefined;
|
|
16
16
|
declare function normalizeOptionalInteger(value: number | undefined, label: string, options?: {
|
|
17
17
|
minimum?: number;
|
|
18
|
+
maximum?: number;
|
|
18
19
|
}): number | undefined;
|
|
20
|
+
declare function normalizeOptionalBoolean(value: boolean | undefined, label: string): boolean | undefined;
|
|
19
21
|
declare function normalizeBackoff(value: number | readonly number[] | undefined): number | readonly number[] | undefined;
|
|
20
22
|
declare function normalizeOptionalHook<THandler extends (...args: never[]) => unknown>(value: THandler | undefined, label: string): THandler | undefined;
|
|
21
23
|
interface QueueJobContext {
|
|
@@ -40,6 +42,7 @@ interface QueueJobDefinition<TPayload extends QueueJsonValue = QueueJsonValue, T
|
|
|
40
42
|
readonly tries?: number;
|
|
41
43
|
readonly backoff?: number | readonly number[];
|
|
42
44
|
readonly timeout?: number;
|
|
45
|
+
readonly failOnTimeout?: boolean;
|
|
43
46
|
readonly onCompleted?: QueueJobCompletedHook<TPayload, TResult>;
|
|
44
47
|
readonly onFailed?: QueueJobFailedHook<TPayload>;
|
|
45
48
|
handle(payload: TPayload, context: QueueJobContext): Promise<TResult> | TResult;
|
|
@@ -64,6 +67,8 @@ interface QueueDispatchOptions {
|
|
|
64
67
|
readonly connection?: string;
|
|
65
68
|
readonly queue?: string;
|
|
66
69
|
readonly delay?: QueueDelayValue;
|
|
70
|
+
readonly tries?: number;
|
|
71
|
+
readonly afterCommit?: boolean;
|
|
67
72
|
}
|
|
68
73
|
interface QueueDispatchResult {
|
|
69
74
|
readonly jobId: string;
|
|
@@ -105,6 +110,7 @@ interface QueuePendingDispatch<TPayload extends QueueJsonValue = QueueJsonValue>
|
|
|
105
110
|
onConnection(name: string): QueuePendingDispatch<TPayload>;
|
|
106
111
|
onQueue(name: string): QueuePendingDispatch<TPayload>;
|
|
107
112
|
delay(value: QueueDelayValue): QueuePendingDispatch<TPayload>;
|
|
113
|
+
afterCommit(): QueuePendingDispatch<TPayload>;
|
|
108
114
|
onComplete(callback: QueueDispatchCompletedHook): QueuePendingDispatch<TPayload>;
|
|
109
115
|
onFailed(callback: QueueDispatchFailedHook): QueuePendingDispatch<TPayload>;
|
|
110
116
|
then<TResult1 = QueueDispatchResult, TResult2 = never>(onfulfilled?: ((value: QueueDispatchResult) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
@@ -151,6 +157,7 @@ interface QueueDriverBase {
|
|
|
151
157
|
readonly name: string;
|
|
152
158
|
readonly driver: NormalizedQueueConnectionConfig['driver'];
|
|
153
159
|
readonly mode: 'sync' | 'async';
|
|
160
|
+
readonly acceptsJobId?: boolean;
|
|
154
161
|
dispatch<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown>(job: QueueJobEnvelope<TPayload>): Promise<QueueDriverDispatchResult<TResult>>;
|
|
155
162
|
clear(input?: QueueClearInput): Promise<number>;
|
|
156
163
|
close(): Promise<void>;
|
|
@@ -161,6 +168,7 @@ interface QueueAsyncDriver extends QueueDriverBase {
|
|
|
161
168
|
acknowledge(job: QueueReservedJob): Promise<void>;
|
|
162
169
|
release(job: QueueReservedJob, options?: QueueReleaseOptions): Promise<void>;
|
|
163
170
|
delete(job: QueueReservedJob): Promise<void>;
|
|
171
|
+
abandon?(job: QueueReservedJob): void;
|
|
164
172
|
}
|
|
165
173
|
interface QueueSyncDriver extends QueueDriverBase {
|
|
166
174
|
readonly mode: 'sync';
|
|
@@ -181,6 +189,7 @@ interface QueueWorkerOptions {
|
|
|
181
189
|
readonly stopWhenEmpty?: boolean;
|
|
182
190
|
readonly sleep?: number;
|
|
183
191
|
readonly tries?: number;
|
|
192
|
+
readonly backoff?: number | readonly number[];
|
|
184
193
|
readonly timeout?: number;
|
|
185
194
|
readonly maxJobs?: number;
|
|
186
195
|
readonly maxTime?: number;
|
|
@@ -241,6 +250,7 @@ interface QueueRedisConnectionConfig {
|
|
|
241
250
|
readonly driver: 'redis';
|
|
242
251
|
readonly connection?: string;
|
|
243
252
|
readonly queue?: string;
|
|
253
|
+
readonly afterCommit?: boolean;
|
|
244
254
|
readonly retryAfter?: number | string;
|
|
245
255
|
readonly blockFor?: number | string;
|
|
246
256
|
readonly redis?: {
|
|
@@ -260,6 +270,7 @@ interface QueueRedisConnectionConfig {
|
|
|
260
270
|
interface QueueDatabaseConnectionConfig {
|
|
261
271
|
readonly driver: 'database';
|
|
262
272
|
readonly queue?: string;
|
|
273
|
+
readonly afterCommit?: boolean;
|
|
263
274
|
readonly retryAfter?: number | string;
|
|
264
275
|
readonly sleep?: number | string;
|
|
265
276
|
readonly connection?: string;
|
|
@@ -268,6 +279,7 @@ interface QueueDatabaseConnectionConfig {
|
|
|
268
279
|
interface QueueSyncConnectionConfig {
|
|
269
280
|
readonly driver: 'sync';
|
|
270
281
|
readonly queue?: string;
|
|
282
|
+
readonly afterCommit?: boolean;
|
|
271
283
|
}
|
|
272
284
|
interface QueuePluginConnectionConfig {
|
|
273
285
|
readonly driver: string;
|
|
@@ -289,12 +301,14 @@ interface NormalizedQueueSyncConnectionConfig {
|
|
|
289
301
|
readonly name: string;
|
|
290
302
|
readonly driver: 'sync';
|
|
291
303
|
readonly queue: string;
|
|
304
|
+
readonly afterCommit: boolean;
|
|
292
305
|
}
|
|
293
306
|
interface NormalizedQueueRedisConnectionConfig {
|
|
294
307
|
readonly name: string;
|
|
295
308
|
readonly driver: 'redis';
|
|
296
309
|
readonly connection: string;
|
|
297
310
|
readonly queue: string;
|
|
311
|
+
readonly afterCommit: boolean;
|
|
298
312
|
readonly retryAfter: number;
|
|
299
313
|
readonly blockFor: number;
|
|
300
314
|
readonly redis: {
|
|
@@ -333,6 +347,7 @@ interface NormalizedQueueDatabaseConnectionConfig {
|
|
|
333
347
|
readonly name: string;
|
|
334
348
|
readonly driver: 'database';
|
|
335
349
|
readonly queue: string;
|
|
350
|
+
readonly afterCommit: boolean;
|
|
336
351
|
readonly retryAfter: number;
|
|
337
352
|
readonly sleep: number;
|
|
338
353
|
readonly connection: string;
|
|
@@ -342,6 +357,7 @@ interface NormalizedQueuePluginConnectionConfig {
|
|
|
342
357
|
readonly name: string;
|
|
343
358
|
readonly driver: string;
|
|
344
359
|
readonly queue: string;
|
|
360
|
+
readonly afterCommit: boolean;
|
|
345
361
|
readonly [key: string]: unknown;
|
|
346
362
|
}
|
|
347
363
|
type NormalizedQueueConnectionConfig = NormalizedQueueSyncConnectionConfig | NormalizedQueueRedisConnectionConfig | NormalizedQueueDatabaseConnectionConfig | NormalizedQueuePluginConnectionConfig;
|
|
@@ -358,6 +374,7 @@ declare const queueJobInternals: {
|
|
|
358
374
|
normalizeQueueJobDefinition: typeof normalizeQueueJobDefinition;
|
|
359
375
|
normalizeBackoff: typeof normalizeBackoff;
|
|
360
376
|
normalizeOptionalHook: typeof normalizeOptionalHook;
|
|
377
|
+
normalizeOptionalBoolean: typeof normalizeOptionalBoolean;
|
|
361
378
|
normalizeOptionalInteger: typeof normalizeOptionalInteger;
|
|
362
379
|
normalizeOptionalString: typeof normalizeOptionalString;
|
|
363
380
|
resolveQueueJobDefinitionName: typeof resolveQueueJobDefinitionName;
|
|
@@ -379,7 +396,9 @@ declare const DEFAULT_REDIS_PORT = 6379;
|
|
|
379
396
|
declare const DEFAULT_REDIS_DB = 0;
|
|
380
397
|
declare function parseInteger(value: number | string | undefined, fallback: number, label: string, options?: {
|
|
381
398
|
minimum?: number;
|
|
399
|
+
maximum?: number;
|
|
382
400
|
}): number;
|
|
401
|
+
declare function assertQueueTimeoutBelowRetryAfter(subject: string, timeoutSeconds: number | undefined, connection: NormalizedQueueConnectionConfig): void;
|
|
383
402
|
declare function normalizeQueueConfig(config?: HoloQueueConfig, redisConfig?: QueueSharedRedisConfig): NormalizedHoloQueueConfig;
|
|
384
403
|
declare const holoQueueDefaults: Readonly<NormalizedHoloQueueConfig>;
|
|
385
404
|
declare const queueInternals: {
|
|
@@ -391,4 +410,5 @@ declare module '@holo-js/config' {
|
|
|
391
410
|
}
|
|
392
411
|
}
|
|
393
412
|
|
|
394
|
-
export {
|
|
413
|
+
export { DEFAULT_DATABASE_QUEUE_TABLE as F, DEFAULT_FAILED_JOBS_CONNECTION as G, DEFAULT_FAILED_JOBS_TABLE as I, DEFAULT_QUEUE_BLOCK_FOR as J, DEFAULT_QUEUE_CONNECTION as K, DEFAULT_QUEUE_NAME as L, DEFAULT_QUEUE_RETRY_AFTER as M, DEFAULT_QUEUE_SLEEP as O, defineJob as a9, holoQueueDefaults as aa, isQueueJobDefinition as ab, normalizeQueueConfig as ac, normalizeQueueJobDefinition as ad, queueInternals as ae, queueJobInternals as af, DEFAULT_REDIS_DB as ag, DEFAULT_REDIS_HOST as ah, DEFAULT_REDIS_PORT as ai, assertQueueTimeoutBelowRetryAfter as aj };
|
|
414
|
+
export type { QueueEnqueueResult as $, QueueWorkerJobEvent as A, QueueAsyncDriver as B, QueueWorkerRunOptions as C, QueueWorkerOptions as D, QueueWorkerResult as E, HoloQueueJobRegistry as H, NormalizedQueueSyncConnectionConfig as N, DefinedQueueJobDefinition as P, QueueRegisteredJob as Q, RegisterableQueueJobDefinition as R, ExportedQueueJobDefinition as S, NormalizedQueueDatabaseConnectionConfig as T, NormalizedQueueFailedStoreConfig as U, NormalizedQueuePluginConnectionConfig as V, NormalizedQueueRedisConnectionConfig as W, QueueConnectionConfig as X, QueueDatabaseConnectionConfig as Y, QueueDispatchCompletedHook as Z, QueueDispatchFailedHook as _, QueueJsonValue as a, QueueFailedStoreConfig as a0, QueueJobDefinition as a1, QueuePluginConnectionConfig as a2, QueueRedisConnectionConfig as a3, QueueReleaseOptions as a4, QueueReserveInput as a5, QueueSharedRedisConnectionConfig as a6, QueueSyncConnectionConfig as a7, QueueWorkerHooks as a8, RegisterQueueJobOptions as b, QueueDriverFactory as c, QueueSyncDriver as d, QueueDriverFactoryContext as e, QueueJobEnvelope as f, QueueDriverDispatchResult as g, QueueConnectionFacade as h, QueuePayloadFor as i, QueueDispatchOptions as j, QueuePendingDispatch as k, QueueResultFor as l, HoloQueueConfig as m, NormalizedHoloQueueConfig as n, QueueSharedRedisConfig as o, QueueFailedJobStore as p, QueueRuntimeBinding as q, QueueDriver as r, QueueJobContextOverrides as s, QueueJobContext as t, QueueDispatchResult as u, QueueDelayValue as v, NormalizedQueueConnectionConfig as w, QueueFailedJobRecord as x, QueueReservedJob as y, QueueClearInput as z };
|
package/dist/config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as DEFAULT_DATABASE_QUEUE_TABLE, G as DEFAULT_FAILED_JOBS_CONNECTION, I as DEFAULT_FAILED_JOBS_TABLE, J as DEFAULT_QUEUE_BLOCK_FOR, K as DEFAULT_QUEUE_CONNECTION, L as DEFAULT_QUEUE_NAME, M as DEFAULT_QUEUE_RETRY_AFTER, O as DEFAULT_QUEUE_SLEEP, ag as DEFAULT_REDIS_DB, ah as DEFAULT_REDIS_HOST, ai as DEFAULT_REDIS_PORT, m as HoloQueueConfig, n as NormalizedHoloQueueConfig, w as NormalizedQueueConnectionConfig, T as NormalizedQueueDatabaseConnectionConfig, U as NormalizedQueueFailedStoreConfig, V as NormalizedQueuePluginConnectionConfig, W as NormalizedQueueRedisConnectionConfig, N as NormalizedQueueSyncConnectionConfig, X as QueueConnectionConfig, Y as QueueDatabaseConnectionConfig, a0 as QueueFailedStoreConfig, a2 as QueuePluginConnectionConfig, a3 as QueueRedisConnectionConfig, o as QueueSharedRedisConfig, a6 as QueueSharedRedisConnectionConfig, a7 as QueueSyncConnectionConfig, aj as assertQueueTimeoutBelowRetryAfter, aa as holoQueueDefaults, ac as normalizeQueueConfig, ae as queueInternals } from './config-Cztv8leT.js';
|
package/dist/config.mjs
CHANGED
|
@@ -10,10 +10,11 @@ import {
|
|
|
10
10
|
DEFAULT_REDIS_DB,
|
|
11
11
|
DEFAULT_REDIS_HOST,
|
|
12
12
|
DEFAULT_REDIS_PORT,
|
|
13
|
+
assertQueueTimeoutBelowRetryAfter,
|
|
13
14
|
holoQueueDefaults,
|
|
14
15
|
normalizeQueueConfig,
|
|
15
16
|
queueInternals
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CYZWPHVL.mjs";
|
|
17
18
|
export {
|
|
18
19
|
DEFAULT_DATABASE_QUEUE_TABLE,
|
|
19
20
|
DEFAULT_FAILED_JOBS_CONNECTION,
|
|
@@ -26,6 +27,7 @@ export {
|
|
|
26
27
|
DEFAULT_REDIS_DB,
|
|
27
28
|
DEFAULT_REDIS_HOST,
|
|
28
29
|
DEFAULT_REDIS_PORT,
|
|
30
|
+
assertQueueTimeoutBelowRetryAfter,
|
|
29
31
|
holoQueueDefaults,
|
|
30
32
|
normalizeQueueConfig,
|
|
31
33
|
queueInternals
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as QueueRegisteredJob, a as QueueJsonValue, R as RegisterableQueueJobDefinition, b as RegisterQueueJobOptions, c as QueueDriverFactory, N as NormalizedQueueSyncConnectionConfig, d as QueueSyncDriver, e as QueueDriverFactoryContext, f as QueueJobEnvelope, g as QueueDriverDispatchResult, h as QueueConnectionFacade, H as HoloQueueJobRegistry, i as QueuePayloadFor, j as QueueDispatchOptions, k as QueuePendingDispatch, l as QueueResultFor, m as HoloQueueConfig, n as NormalizedHoloQueueConfig, o as QueueSharedRedisConfig, p as QueueFailedJobStore, q as QueueRuntimeBinding, r as QueueDriver, s as QueueJobContextOverrides, t as QueueJobContext, u as QueueDispatchResult, v as QueueDelayValue, w as NormalizedQueueConnectionConfig, x as QueueFailedJobRecord, y as QueueReservedJob, z as QueueClearInput, A as QueueWorkerJobEvent, B as QueueAsyncDriver, C as QueueWorkerRunOptions, D as
|
|
2
|
-
export {
|
|
1
|
+
import { Q as QueueRegisteredJob, a as QueueJsonValue, R as RegisterableQueueJobDefinition, b as RegisterQueueJobOptions, c as QueueDriverFactory, N as NormalizedQueueSyncConnectionConfig, d as QueueSyncDriver, e as QueueDriverFactoryContext, f as QueueJobEnvelope, g as QueueDriverDispatchResult, h as QueueConnectionFacade, H as HoloQueueJobRegistry, i as QueuePayloadFor, j as QueueDispatchOptions, k as QueuePendingDispatch, l as QueueResultFor, m as HoloQueueConfig, n as NormalizedHoloQueueConfig, o as QueueSharedRedisConfig, p as QueueFailedJobStore, q as QueueRuntimeBinding, r as QueueDriver, s as QueueJobContextOverrides, t as QueueJobContext, u as QueueDispatchResult, v as QueueDelayValue, w as NormalizedQueueConnectionConfig, x as QueueFailedJobRecord, y as QueueReservedJob, z as QueueClearInput, A as QueueWorkerJobEvent, B as QueueAsyncDriver, C as QueueWorkerRunOptions, D as QueueWorkerOptions, E as QueueWorkerResult } from './config-Cztv8leT.js';
|
|
2
|
+
export { F as DEFAULT_DATABASE_QUEUE_TABLE, G as DEFAULT_FAILED_JOBS_CONNECTION, I as DEFAULT_FAILED_JOBS_TABLE, J as DEFAULT_QUEUE_BLOCK_FOR, K as DEFAULT_QUEUE_CONNECTION, L as DEFAULT_QUEUE_NAME, M as DEFAULT_QUEUE_RETRY_AFTER, O as DEFAULT_QUEUE_SLEEP, P as DefinedQueueJobDefinition, S as ExportedQueueJobDefinition, T as NormalizedQueueDatabaseConnectionConfig, U as NormalizedQueueFailedStoreConfig, V as NormalizedQueuePluginConnectionConfig, W as NormalizedQueueRedisConnectionConfig, X as QueueConnectionConfig, Y as QueueDatabaseConnectionConfig, Z as QueueDispatchCompletedHook, _ as QueueDispatchFailedHook, $ as QueueEnqueueResult, a0 as QueueFailedStoreConfig, a1 as QueueJobDefinition, a2 as QueuePluginConnectionConfig, a3 as QueueRedisConnectionConfig, a4 as QueueReleaseOptions, a5 as QueueReserveInput, a6 as QueueSharedRedisConnectionConfig, a7 as QueueSyncConnectionConfig, a8 as QueueWorkerHooks, a9 as defineJob, aa as holoQueueDefaults, ab as isQueueJobDefinition, ac as normalizeQueueConfig, ad as normalizeQueueJobDefinition, ae as queueInternals, af as queueJobInternals } from './config-Cztv8leT.js';
|
|
3
3
|
|
|
4
4
|
declare function deriveJobNameFromSourcePath(sourcePath: string): string;
|
|
5
5
|
declare function registerQueueJob<TPayload extends QueueJsonValue, TResult>(definition: RegisterableQueueJobDefinition<TPayload, TResult>, options?: RegisterQueueJobOptions): QueueRegisteredJob<TPayload, TResult>;
|
|
@@ -19,6 +19,7 @@ declare class SyncQueueDriver implements QueueSyncDriver {
|
|
|
19
19
|
readonly name: string;
|
|
20
20
|
readonly driver: "sync";
|
|
21
21
|
readonly mode: "sync";
|
|
22
|
+
readonly acceptsJobId = true;
|
|
22
23
|
private readonly context;
|
|
23
24
|
constructor(connection: NormalizedQueueSyncConnectionConfig, context: QueueDriverFactoryContext);
|
|
24
25
|
dispatch<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown>(job: QueueJobEnvelope<TPayload>): Promise<QueueDriverDispatchResult<TResult>>;
|
|
@@ -69,10 +70,26 @@ declare function resolveDriverFactory(state: RuntimeQueueState, connection: Norm
|
|
|
69
70
|
declare function loadQueuePluginDrivers(projectRoot?: string, pluginNames?: readonly string[]): Promise<void>;
|
|
70
71
|
declare function resolveConnectionDriver(connectionName?: string): QueueDriver;
|
|
71
72
|
declare function resolveSyncExecutionDriver(): QueueDriver;
|
|
72
|
-
declare function createJobEnvelope<TPayload extends QueueJsonValue>(jobName: string, payload: TPayload, options: QueueDispatchOptions
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
declare function createJobEnvelope<TPayload extends QueueJsonValue>(jobName: string, payload: TPayload, options: QueueDispatchOptions, { validateTimeout }?: {
|
|
74
|
+
validateTimeout?: boolean;
|
|
75
|
+
}): QueueJobEnvelope<TPayload>;
|
|
76
|
+
declare function createDispatchEnvelope<TPayload extends QueueJsonValue>(jobName: string, payload: TPayload, options?: QueueDispatchOptions, { runsInline }?: {
|
|
77
|
+
runsInline?: boolean;
|
|
78
|
+
}): QueueJobEnvelope<TPayload>;
|
|
79
|
+
type DispatchOutcomeHandlers = {
|
|
80
|
+
completed(result: QueueDispatchResult): Promise<void>;
|
|
81
|
+
failed(error: unknown): Promise<void>;
|
|
82
|
+
};
|
|
83
|
+
declare function dispatchRecord(envelope: QueueJobEnvelope, options: Pick<QueueDispatchOptions, 'afterCommit'>, handlers: DispatchOutcomeHandlers): Promise<QueueDispatchResult>;
|
|
75
84
|
declare function createQueueConnection(name?: string): QueueConnectionFacade;
|
|
85
|
+
type QueueJobTimeoutCandidate = {
|
|
86
|
+
readonly name: string;
|
|
87
|
+
readonly definition: {
|
|
88
|
+
readonly timeout?: number;
|
|
89
|
+
readonly connection?: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
declare function assertQueueJobTimeouts(jobs: readonly QueueJobTimeoutCandidate[]): void;
|
|
76
93
|
declare function configureQueueRuntime(options?: ConfigureQueueRuntimeOptions): void;
|
|
77
94
|
declare function resetQueueRuntimeState(state: RuntimeQueueState): void;
|
|
78
95
|
declare function shutdownQueueRuntime(): Promise<void>;
|
|
@@ -170,15 +187,16 @@ type QueueWorkerProcessingOutcome = {
|
|
|
170
187
|
};
|
|
171
188
|
declare function sleep(milliseconds: number): Promise<void>;
|
|
172
189
|
declare function requireAsyncDriver(driver: QueueDriver, connectionName: string): QueueAsyncDriver;
|
|
173
|
-
declare function requireRegisteredDefinition(jobName: string): QueueJobDefinition;
|
|
174
190
|
declare function normalizeQueueNames(queueNames: readonly string[] | undefined, fallbackQueueName: string | undefined): readonly string[];
|
|
175
|
-
declare function normalizeNonNegativeInteger(value: number | undefined, label: string
|
|
191
|
+
declare function normalizeNonNegativeInteger(value: number | undefined, label: string, options?: {
|
|
192
|
+
maximum?: number;
|
|
193
|
+
}): number | undefined;
|
|
176
194
|
declare function normalizePositiveInteger(value: number | undefined, label: string): number | undefined;
|
|
177
195
|
declare function createWorkerEvent(envelope: QueueJobEnvelope, maxAttempts: number): QueueWorkerJobEvent;
|
|
178
|
-
declare function resolveRetryDelaySeconds(
|
|
179
|
-
declare function runWorkerHook(
|
|
196
|
+
declare function resolveRetryDelaySeconds(backoff: number | readonly number[] | undefined, attempt: number): number | undefined;
|
|
197
|
+
declare function runWorkerHook(hookName: 'onJobFailed' | 'onJobProcessed' | 'onJobReleased', callback: () => void | Promise<void>): Promise<void>;
|
|
180
198
|
declare function runWithTimeout<TResult>(callback: Promise<TResult>, jobName: string, timeoutSeconds: number | undefined, onTimeout?: () => void): Promise<TResult>;
|
|
181
|
-
declare function processReservedJob(driver: QueueAsyncDriver, reserved: QueueReservedJob<QueueJsonValue>, options: Pick<QueueWorkerRunOptions, 'timeout' | 'tries' | 'onJobFailed' | 'onJobProcessed' | 'onJobReleased'>): Promise<QueueWorkerProcessingOutcome>;
|
|
199
|
+
declare function processReservedJob(driver: QueueAsyncDriver, reserved: QueueReservedJob<QueueJsonValue>, options: Pick<QueueWorkerRunOptions, 'timeout' | 'tries' | 'backoff' | 'onJobFailed' | 'onJobProcessed' | 'onJobReleased'>): Promise<QueueWorkerProcessingOutcome>;
|
|
182
200
|
declare function resolveWorkerStopReason(options: QueueWorkerOptions, state: {
|
|
183
201
|
readonly processed: number;
|
|
184
202
|
readonly startedAt: number;
|
|
@@ -192,7 +210,6 @@ declare const queueWorkerInternals: {
|
|
|
192
210
|
normalizeQueueNames: typeof normalizeQueueNames;
|
|
193
211
|
processReservedJob: typeof processReservedJob;
|
|
194
212
|
requireAsyncDriver: typeof requireAsyncDriver;
|
|
195
|
-
requireRegisteredDefinition: typeof requireRegisteredDefinition;
|
|
196
213
|
resolveRetryDelaySeconds: typeof resolveRetryDelaySeconds;
|
|
197
214
|
resolveWorkerStopReason: typeof resolveWorkerStopReason;
|
|
198
215
|
runWithTimeout: typeof runWithTimeout;
|
|
@@ -202,4 +219,4 @@ declare const queueWorkerInternals: {
|
|
|
202
219
|
|
|
203
220
|
declare function defineQueueConfig<TConfig extends HoloQueueConfig>(config: TConfig): Readonly<TConfig>;
|
|
204
221
|
|
|
205
|
-
export { HoloQueueConfig, HoloQueueJobRegistry, NormalizedHoloQueueConfig, NormalizedQueueConnectionConfig, NormalizedQueueSyncConnectionConfig, Queue, QueueAsyncDriver, QueueClearInput, QueueConnectionFacade, QueueDelayValue, QueueDispatchOptions, QueueDispatchResult, QueueDriver, QueueDriverDispatchResult, QueueDriverFactory, QueueDriverFactoryContext, QueueFailedJobRecord, QueueFailedJobStore, QueueFailedStoreError, QueueJobContext, QueueJobContextOverrides,
|
|
222
|
+
export { HoloQueueConfig, HoloQueueJobRegistry, NormalizedHoloQueueConfig, NormalizedQueueConnectionConfig, NormalizedQueueSyncConnectionConfig, Queue, QueueAsyncDriver, QueueClearInput, QueueConnectionFacade, QueueDelayValue, QueueDispatchOptions, QueueDispatchResult, QueueDriver, QueueDriverDispatchResult, QueueDriverFactory, QueueDriverFactoryContext, QueueFailedJobRecord, QueueFailedJobStore, QueueFailedStoreError, QueueJobContext, QueueJobContextOverrides, QueueJobEnvelope, QueueJsonValue, QueuePayloadFor, QueuePendingDispatch, QueueRegisteredJob, QueueReleaseUnsupportedError, QueueReservedJob, QueueResultFor, QueueRuntimeBinding, QueueSharedRedisConfig, QueueSyncDriver, QueueWorkerJobEvent, QueueWorkerOptions, QueueWorkerResult, QueueWorkerRunOptions, QueueWorkerTimeoutError, QueueWorkerUnsupportedDriverError, RegisterQueueJobOptions, RegisterableQueueJobDefinition, assertQueueJobTimeouts, clearQueueConnection, configureQueueRuntime, defineQueueConfig, dispatch, dispatchSync, flushFailedQueueJobs, forgetFailedQueueJob, getQueueRuntime, getRegisteredQueueJob, listFailedQueueJobs, listRegisteredQueueJobs, loadQueuePluginDriverFactories, loadQueuePluginDrivers, persistFailedQueueJob, queueFailedInternals, queueRegistryInternals, queueRuntimeInternals, queueWorkerInternals, registerQueueJob, registerQueueJobs, resetQueuePluginDriverFactories, resetQueueRegistry, resetQueueRuntime, retryFailedQueueJobs, runQueueWorker, shutdownQueueRuntime, syncQueueDriverFactory, syncQueueDriverInternals, unregisterQueueJob, useQueueConnection };
|