bullmq 6.4.2 → 6.5.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/dist/cjs/classes/bun-redis-client.js +6 -6
- package/dist/cjs/classes/child-pool.js +1 -1
- package/dist/cjs/classes/child.js +8 -8
- package/dist/cjs/classes/flow-producer.js +2 -2
- package/dist/cjs/classes/job.js +2 -2
- package/dist/cjs/classes/main-worker.js +2 -2
- package/dist/cjs/classes/node-redis-client.js +6 -6
- package/dist/cjs/classes/queue-base.js +2 -2
- package/dist/cjs/classes/redis-connection.js +2 -2
- package/dist/cjs/classes/redis-queue-backend.js +2 -2
- package/dist/cjs/classes/redis-relay-backend.js +2 -2
- package/dist/cjs/classes/relay.js +8 -8
- package/dist/cjs/classes/valkey-glide-client.js +6 -6
- package/dist/cjs/classes/worker.js +4 -4
- package/dist/cjs/postgres/postgres-connection.js +2 -2
- package/dist/cjs/postgres/postgres-queue-backend.js +2 -2
- package/dist/cjs/postgres/postgres-relay-backend.js +4 -4
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils/index.js +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/esm/classes/bun-redis-client.js +3 -3
- package/dist/esm/classes/child-pool.js +1 -1
- package/dist/esm/classes/child.d.ts +3 -3
- package/dist/esm/classes/child.js +4 -4
- package/dist/esm/classes/flow-producer.d.ts +1 -1
- package/dist/esm/classes/flow-producer.js +1 -1
- package/dist/esm/classes/job.js +1 -1
- package/dist/esm/classes/main-worker.js +1 -1
- package/dist/esm/classes/node-redis-client.js +3 -3
- package/dist/esm/classes/queue-base.d.ts +1 -1
- package/dist/esm/classes/queue-base.js +1 -1
- package/dist/esm/classes/redis-connection.d.ts +1 -1
- package/dist/esm/classes/redis-connection.js +1 -1
- package/dist/esm/classes/redis-queue-backend.d.ts +1 -1
- package/dist/esm/classes/redis-queue-backend.js +1 -1
- package/dist/esm/classes/redis-relay-backend.d.ts +1 -1
- package/dist/esm/classes/redis-relay-backend.js +1 -1
- package/dist/esm/classes/relay.d.ts +1 -1
- package/dist/esm/classes/relay.js +3 -3
- package/dist/esm/classes/valkey-glide-client.js +3 -3
- package/dist/esm/classes/worker.d.ts +1 -1
- package/dist/esm/classes/worker.js +3 -3
- package/dist/esm/interfaces/connection.d.ts +1 -1
- package/dist/esm/interfaces/redis-client.d.ts +1 -1
- package/dist/esm/interfaces/sandboxed-options.d.ts +2 -2
- package/dist/esm/postgres/postgres-connection.d.ts +1 -1
- package/dist/esm/postgres/postgres-connection.js +1 -1
- package/dist/esm/postgres/postgres-queue-backend.d.ts +1 -1
- package/dist/esm/postgres/postgres-queue-backend.js +1 -1
- package/dist/esm/postgres/postgres-relay-backend.d.ts +1 -1
- package/dist/esm/postgres/postgres-relay-backend.js +2 -2
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/utils/index.d.ts +2 -2
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBunRedisClient = createBunRedisClient;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const node_events_1 = require("node:events");
|
|
6
|
+
const node_stream_1 = require("node:stream");
|
|
7
7
|
const connection_closed_error_1 = require("./errors/connection-closed-error");
|
|
8
8
|
function normalizeScriptArgs(args) {
|
|
9
9
|
return args.length === 1 && Array.isArray(args[0]) ? args[0] : args;
|
|
@@ -47,7 +47,7 @@ function createBunRedisClient(client, opts) {
|
|
|
47
47
|
* 3. Raw command execution: Bun's `send()` is the universal escape hatch
|
|
48
48
|
* for commands without convenience methods.
|
|
49
49
|
*/
|
|
50
|
-
class BunRedisAdapter extends
|
|
50
|
+
class BunRedisAdapter extends node_events_1.EventEmitter {
|
|
51
51
|
get status() {
|
|
52
52
|
var _a;
|
|
53
53
|
if (this.statusOverride) {
|
|
@@ -469,7 +469,7 @@ class BunRedisAdapter extends events_1.EventEmitter {
|
|
|
469
469
|
// Lua script engine
|
|
470
470
|
// ---------------------------------------------------------------
|
|
471
471
|
defineCommand(name, definition) {
|
|
472
|
-
const sha = (0,
|
|
472
|
+
const sha = (0, node_crypto_1.createHash)('sha1').update(definition.lua).digest('hex');
|
|
473
473
|
this.scripts.set(name, {
|
|
474
474
|
sha,
|
|
475
475
|
lua: definition.lua,
|
|
@@ -866,7 +866,7 @@ class BunRedisAdapter extends events_1.EventEmitter {
|
|
|
866
866
|
const adapter = this;
|
|
867
867
|
let cursor = '0';
|
|
868
868
|
let started = false;
|
|
869
|
-
const readable = new
|
|
869
|
+
const readable = new node_stream_1.Readable({
|
|
870
870
|
objectMode: true,
|
|
871
871
|
async read() {
|
|
872
872
|
if (started && cursor === '0') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChildPool = void 0;
|
|
4
|
-
const path = require("path");
|
|
4
|
+
const path = require("node:path");
|
|
5
5
|
const child_1 = require("./child");
|
|
6
6
|
const CHILD_KILL_TIMEOUT = 30000;
|
|
7
7
|
const supportCJS = () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Child = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_net_1 = require("node:net");
|
|
6
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
7
7
|
const enums_1 = require("../enums");
|
|
8
|
-
const
|
|
8
|
+
const node_events_1 = require("node:events");
|
|
9
9
|
/**
|
|
10
10
|
* @see https://nodejs.org/api/process.html#process_exit_codes
|
|
11
11
|
*/
|
|
@@ -30,7 +30,7 @@ const exitCodesErrors = {
|
|
|
30
30
|
* isolated processes or threads for processing jobs.
|
|
31
31
|
*
|
|
32
32
|
*/
|
|
33
|
-
class Child extends
|
|
33
|
+
class Child extends node_events_1.EventEmitter {
|
|
34
34
|
constructor(mainFile, processFile, opts = {
|
|
35
35
|
useWorkerThreads: false,
|
|
36
36
|
}) {
|
|
@@ -72,12 +72,12 @@ class Child extends events_1.EventEmitter {
|
|
|
72
72
|
const execArgv = await convertExecArgv(process.execArgv);
|
|
73
73
|
let parent;
|
|
74
74
|
if (this.opts.useWorkerThreads) {
|
|
75
|
-
this.worker = parent = new
|
|
75
|
+
this.worker = parent = new node_worker_threads_1.Worker(this.mainFile, Object.assign({ execArgv, stdin: true, stdout: true, stderr: true }, (this.opts.workerThreadsOptions
|
|
76
76
|
? this.opts.workerThreadsOptions
|
|
77
77
|
: {})));
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
this.childProcess = parent = (0,
|
|
80
|
+
this.childProcess = parent = (0, node_child_process_1.fork)(this.mainFile, [], Object.assign({ execArgv, stdio: 'pipe' }, (this.opts.workerForkOptions ? this.opts.workerForkOptions : {})));
|
|
81
81
|
}
|
|
82
82
|
parent.on('exit', (exitCode, signalCode) => {
|
|
83
83
|
this._exitCode = exitCode;
|
|
@@ -195,7 +195,7 @@ function onExitOnce(child) {
|
|
|
195
195
|
}
|
|
196
196
|
const getFreePort = async () => {
|
|
197
197
|
return new Promise(resolve => {
|
|
198
|
-
const server = (0,
|
|
198
|
+
const server = (0, node_net_1.createServer)();
|
|
199
199
|
server.listen(0, () => {
|
|
200
200
|
const { port } = server.address();
|
|
201
201
|
server.close(() => resolve(port));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowProducer = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const create_backend_1 = require("../utils/create-backend");
|
|
7
7
|
const job_1 = require("./job");
|
|
@@ -14,7 +14,7 @@ const enums_1 = require("../enums");
|
|
|
14
14
|
* will be processed, being able to access the children's result data.
|
|
15
15
|
* All Jobs can be in different queues, either children or parents,
|
|
16
16
|
*/
|
|
17
|
-
class FlowProducer extends
|
|
17
|
+
class FlowProducer extends node_events_1.EventEmitter {
|
|
18
18
|
constructor(opts, backendFactory) {
|
|
19
19
|
super();
|
|
20
20
|
this.opts = Object.assign(opts === undefined ? { connection: {} } : {}, opts);
|
package/dist/cjs/classes/job.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Job = exports.PRIORITY_LIMIT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const node_util_1 = require("node:util");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const backoffs_1 = require("./backoffs");
|
|
8
8
|
const unrecoverable_error_1 = require("./errors/unrecoverable-error");
|
|
9
9
|
const enums_1 = require("../enums");
|
|
10
|
-
const logger = (0,
|
|
10
|
+
const logger = (0, node_util_1.debuglog)('bull');
|
|
11
11
|
exports.PRIORITY_LIMIT = 2 ** 21 - 1;
|
|
12
12
|
/**
|
|
13
13
|
* Job
|
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
* Worker Thread wrapper for sandboxing
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
7
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
8
8
|
const main_base_1 = require("./main-base");
|
|
9
|
-
(0, main_base_1.default)(async (msg) =>
|
|
9
|
+
(0, main_base_1.default)(async (msg) => node_worker_threads_1.parentPort.postMessage(msg), node_worker_threads_1.parentPort);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodeRedisClient = createNodeRedisClient;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const node_events_1 = require("node:events");
|
|
7
|
+
const node_stream_1 = require("node:stream");
|
|
8
8
|
const connection_closed_error_1 = require("./errors/connection-closed-error");
|
|
9
9
|
function normalizeScriptArgs(args) {
|
|
10
10
|
return args.length === 1 && Array.isArray(args[0]) ? args[0] : args;
|
|
@@ -21,7 +21,7 @@ function createNodeRedisClient(client) {
|
|
|
21
21
|
* Full wrapper (not augmentation) because node-redis's API is structurally
|
|
22
22
|
* different from ioredis and cannot be patched in-place.
|
|
23
23
|
*/
|
|
24
|
-
class NodeRedisAdapter extends
|
|
24
|
+
class NodeRedisAdapter extends node_events_1.EventEmitter {
|
|
25
25
|
/**
|
|
26
26
|
* Expose connection status using the vocabulary that
|
|
27
27
|
* {@link RedisConnection.waitUntilReady} expects:
|
|
@@ -239,7 +239,7 @@ class NodeRedisAdapter extends events_1.EventEmitter {
|
|
|
239
239
|
// Lua script engine
|
|
240
240
|
// ---------------------------------------------------------------
|
|
241
241
|
defineCommand(name, definition) {
|
|
242
|
-
const sha = (0,
|
|
242
|
+
const sha = (0, node_crypto_1.createHash)('sha1').update(definition.lua).digest('hex');
|
|
243
243
|
this.scripts.set(name, {
|
|
244
244
|
sha,
|
|
245
245
|
lua: definition.lua,
|
|
@@ -550,7 +550,7 @@ class NodeRedisAdapter extends events_1.EventEmitter {
|
|
|
550
550
|
if (options.count) {
|
|
551
551
|
scanOpts.COUNT = options.count;
|
|
552
552
|
}
|
|
553
|
-
const readable = new
|
|
553
|
+
const readable = new node_stream_1.Readable({
|
|
554
554
|
objectMode: true,
|
|
555
555
|
async read() {
|
|
556
556
|
var _a, e_1, _b, _c;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueueBase = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const create_backend_1 = require("../utils/create-backend");
|
|
7
7
|
const job_1 = require("./job");
|
|
@@ -10,7 +10,7 @@ const job_1 = require("./job");
|
|
|
10
10
|
* This class is normally not used directly, but extended by the other classes.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
class QueueBase extends
|
|
13
|
+
class QueueBase extends node_events_1.EventEmitter {
|
|
14
14
|
constructor(name, opts, backendFactory, hasBlockingConnection = false) {
|
|
15
15
|
super();
|
|
16
16
|
this.closed = false;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RedisConnection = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const node_events_1 = require("node:events");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const version_1 = require("../version");
|
|
8
8
|
const scripts = require("../scripts");
|
|
@@ -97,7 +97,7 @@ function wrapRedisInstance(instance) {
|
|
|
97
97
|
// Default: treat as an ioredis instance (backwards compatible).
|
|
98
98
|
return (0, ioredis_client_1.createIORedisClient)(instance);
|
|
99
99
|
}
|
|
100
|
-
class RedisConnection extends
|
|
100
|
+
class RedisConnection extends node_events_1.EventEmitter {
|
|
101
101
|
constructor(opts, extraOptions) {
|
|
102
102
|
super();
|
|
103
103
|
this.extraOptions = extraOptions;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RedisQueueBackend = void 0;
|
|
7
7
|
exports.raw2NextJobData = raw2NextJobData;
|
|
8
|
-
const
|
|
8
|
+
const node_events_1 = require("node:events");
|
|
9
9
|
const msgpackr_1 = require("msgpackr");
|
|
10
10
|
const packer = new msgpackr_1.Packr({
|
|
11
11
|
useRecords: false,
|
|
@@ -61,7 +61,7 @@ async function resetBlockedConnection(connection, client, reconnect) {
|
|
|
61
61
|
await reconnect();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
class RedisQueueBackend extends
|
|
64
|
+
class RedisQueueBackend extends node_events_1.EventEmitter {
|
|
65
65
|
constructor(connection, name, keys, toKey, opts, blockingConnection, ownsConnection = true) {
|
|
66
66
|
var _a;
|
|
67
67
|
super();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createRedisRelayBackend = exports.RedisRelayBackend = exports.RELAY_LAYOUT_VERSION = exports.RELAY_MINIMUM_REDIS_VERSION = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const redis_connection_1 = require("./redis-connection");
|
|
7
7
|
const relay_errors_1 = require("./relay-errors");
|
|
@@ -54,7 +54,7 @@ exports.RELAY_LAYOUT_VERSION = '1';
|
|
|
54
54
|
* connection. Entries published while that connection is reconnecting are
|
|
55
55
|
* read once it's back.
|
|
56
56
|
*/
|
|
57
|
-
class RedisRelayBackend extends
|
|
57
|
+
class RedisRelayBackend extends node_events_1.EventEmitter {
|
|
58
58
|
constructor(opts) {
|
|
59
59
|
var _a, _b, _c, _d, _e;
|
|
60
60
|
super();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Relay = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const node_os_1 = require("node:os");
|
|
7
7
|
const redis_relay_backend_1 = require("./redis-relay-backend");
|
|
8
8
|
const version_1 = require("../version");
|
|
9
9
|
const ID_RE = /^[A-Za-z0-9_-]{1,64}$/;
|
|
@@ -28,7 +28,7 @@ const MAX_NAME_LENGTH = 256;
|
|
|
28
28
|
* @experimental The API may change in minor releases while the relay is
|
|
29
29
|
* completed.
|
|
30
30
|
*/
|
|
31
|
-
class Relay extends
|
|
31
|
+
class Relay extends node_events_1.EventEmitter {
|
|
32
32
|
constructor(opts) {
|
|
33
33
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34
34
|
super();
|
|
@@ -46,7 +46,7 @@ class Relay extends events_1.EventEmitter {
|
|
|
46
46
|
throw new Error('Relay requires a connection');
|
|
47
47
|
}
|
|
48
48
|
this.namespace = (_a = opts.namespace) !== null && _a !== void 0 ? _a : 'default';
|
|
49
|
-
this.nodeId = (_b = opts.nodeId) !== null && _b !== void 0 ? _b : (0,
|
|
49
|
+
this.nodeId = (_b = opts.nodeId) !== null && _b !== void 0 ? _b : (0, node_crypto_1.randomUUID)().replace(/-/g, '');
|
|
50
50
|
for (const [name, value] of [
|
|
51
51
|
['namespace', this.namespace],
|
|
52
52
|
['nodeId', this.nodeId],
|
|
@@ -92,7 +92,7 @@ class Relay extends events_1.EventEmitter {
|
|
|
92
92
|
inboxMaxLength: this.inboxMaxLength,
|
|
93
93
|
skipVersionCheck: opts.skipVersionCheck,
|
|
94
94
|
});
|
|
95
|
-
if (this.backend instanceof
|
|
95
|
+
if (this.backend instanceof node_events_1.EventEmitter) {
|
|
96
96
|
this.backend.on('error', err => this.emitError(err));
|
|
97
97
|
}
|
|
98
98
|
this.cursor = this.backend.initialInboxCursor;
|
|
@@ -110,7 +110,7 @@ class Relay extends events_1.EventEmitter {
|
|
|
110
110
|
var _a;
|
|
111
111
|
await this.ready;
|
|
112
112
|
this.assertOpen();
|
|
113
|
-
const endpointId = (0,
|
|
113
|
+
const endpointId = (0, node_crypto_1.randomUUID)().replace(/-/g, '');
|
|
114
114
|
const endpoint = {
|
|
115
115
|
pattern,
|
|
116
116
|
listener,
|
|
@@ -399,7 +399,7 @@ class Relay extends events_1.EventEmitter {
|
|
|
399
399
|
register() {
|
|
400
400
|
return this.backend.registerNode(this.nodeId, this.leaseDuration, {
|
|
401
401
|
name: this.opts.name,
|
|
402
|
-
host: (0,
|
|
402
|
+
host: (0, node_os_1.hostname)(),
|
|
403
403
|
pid: process.pid,
|
|
404
404
|
version: version_1.version,
|
|
405
405
|
}, this.inboxMaxLength);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createValkeyGlideClient = createValkeyGlideClient;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const node_events_1 = require("node:events");
|
|
6
|
+
const node_stream_1 = require("node:stream");
|
|
7
7
|
const connection_closed_error_1 = require("./errors/connection-closed-error");
|
|
8
8
|
const GLIDE_STRING_DECODER = 1;
|
|
9
9
|
function createCompatibilityBatch() {
|
|
@@ -211,7 +211,7 @@ function isBlockingCommand(args) {
|
|
|
211
211
|
function createValkeyGlideClient(client) {
|
|
212
212
|
return new ValkeyGlideAdapter(client);
|
|
213
213
|
}
|
|
214
|
-
class ValkeyGlideAdapter extends
|
|
214
|
+
class ValkeyGlideAdapter extends node_events_1.EventEmitter {
|
|
215
215
|
constructor(rawOrPromise, connectionName) {
|
|
216
216
|
super();
|
|
217
217
|
this.connectionName = connectionName;
|
|
@@ -491,7 +491,7 @@ class ValkeyGlideAdapter extends events_1.EventEmitter {
|
|
|
491
491
|
return new ValkeyGlideAdapter(duplicated, options.connectionName);
|
|
492
492
|
}
|
|
493
493
|
defineCommand(name, definition) {
|
|
494
|
-
const sha = (0,
|
|
494
|
+
const sha = (0, node_crypto_1.createHash)('sha1').update(definition.lua).digest('hex');
|
|
495
495
|
const script = {
|
|
496
496
|
sha,
|
|
497
497
|
lua: definition.lua,
|
|
@@ -736,7 +736,7 @@ class ValkeyGlideAdapter extends events_1.EventEmitter {
|
|
|
736
736
|
scanStream(options) {
|
|
737
737
|
let cursor = '0';
|
|
738
738
|
let running = false;
|
|
739
|
-
const stream = new
|
|
739
|
+
const stream = new node_stream_1.Readable({
|
|
740
740
|
objectMode: true,
|
|
741
741
|
read: () => {
|
|
742
742
|
if (running) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Worker = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const
|
|
6
|
-
const path = require("path");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const node_url_1 = require("node:url");
|
|
6
|
+
const path = require("node:path");
|
|
7
7
|
const abort_controller_1 = require("./abort-controller");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
9
|
const queue_base_1 = require("./queue-base");
|
|
@@ -87,7 +87,7 @@ class Worker extends queue_base_1.QueueBase {
|
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
// SANDBOXED
|
|
90
|
-
if (processor instanceof
|
|
90
|
+
if (processor instanceof node_url_1.URL) {
|
|
91
91
|
if (!fs.existsSync(processor)) {
|
|
92
92
|
throw new Error(`URL ${processor} does not exist in the local file system`);
|
|
93
93
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PostgresConnection = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const node_events_1 = require("node:events");
|
|
6
6
|
const pg_types_1 = require("./pg-types");
|
|
7
7
|
const migrator_1 = require("./migrator");
|
|
8
8
|
/**
|
|
@@ -69,7 +69,7 @@ function enableSocketKeepAlive(client) {
|
|
|
69
69
|
* surfaces normalized `'ready' | 'error' | 'close'` events and exposes
|
|
70
70
|
* {@link PostgresConnection.waitUntilReady} and {@link PostgresConnection.close}.
|
|
71
71
|
*/
|
|
72
|
-
class PostgresConnection extends
|
|
72
|
+
class PostgresConnection extends node_events_1.EventEmitter {
|
|
73
73
|
constructor(connection) {
|
|
74
74
|
var _a;
|
|
75
75
|
super();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PostgresQueueBackend = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const node_events_1 = require("node:events");
|
|
6
6
|
const finished_errors_1 = require("../classes/finished-errors");
|
|
7
7
|
const sql_loader_1 = require("./sql-loader");
|
|
8
8
|
/** Parses a nullable `bigint`-as-string column into a number, or `undefined`. */
|
|
@@ -154,7 +154,7 @@ function mapSchedulerRow(row) {
|
|
|
154
154
|
* Worker, FlowProducer) depend only on {@link IQueueBackend} and never touch a
|
|
155
155
|
* `pg` client directly.
|
|
156
156
|
*/
|
|
157
|
-
class PostgresQueueBackend extends
|
|
157
|
+
class PostgresQueueBackend extends node_events_1.EventEmitter {
|
|
158
158
|
constructor(connection, queueName, opts, ownsConnection = true,
|
|
159
159
|
/**
|
|
160
160
|
* When set, the name applied to this backend's dedicated connection (its
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPostgresRelayBackend = exports.PostgresRelayBackend = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const node_events_1 = require("node:events");
|
|
6
6
|
const relay_errors_1 = require("../classes/relay-errors");
|
|
7
7
|
const pg_types_1 = require("./pg-types");
|
|
8
8
|
const postgres_connection_1 = require("./postgres-connection");
|
|
@@ -26,7 +26,7 @@ const APPLICATION_NAME_PREFIX = 'bullmq:relay:';
|
|
|
26
26
|
* delivery). Entries are acknowledged by id, which never skips a row whose
|
|
27
27
|
* transaction committed late.
|
|
28
28
|
*/
|
|
29
|
-
class PostgresRelayBackend extends
|
|
29
|
+
class PostgresRelayBackend extends node_events_1.EventEmitter {
|
|
30
30
|
constructor(opts) {
|
|
31
31
|
var _a;
|
|
32
32
|
super();
|
|
@@ -278,7 +278,7 @@ class PostgresRelayBackend extends events_1.EventEmitter {
|
|
|
278
278
|
}
|
|
279
279
|
/** `application_name` of a node's inbox connection. */
|
|
280
280
|
inboxConnectionName(nodeId, database, schema) {
|
|
281
|
-
const digest = (0,
|
|
281
|
+
const digest = (0, node_crypto_1.createHash)('sha256')
|
|
282
282
|
.update(JSON.stringify([database, schema, this.namespace, nodeId]))
|
|
283
283
|
.digest('hex');
|
|
284
284
|
return `${APPLICATION_NAME_PREFIX}${digest.slice(0, MAX_APPLICATION_NAME - APPLICATION_NAME_PREFIX.length)}`;
|