@forklaunch/implementation-worker-bullmq 0.3.3 → 0.3.4
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/lib/consumers/index.d.mts +12 -25
- package/lib/consumers/index.d.ts +12 -25
- package/lib/consumers/index.js +10 -15
- package/lib/consumers/index.mjs +6 -4
- package/lib/domain/schemas/index.d.mts +10 -56
- package/lib/domain/schemas/index.d.ts +10 -56
- package/lib/domain/schemas/index.js +491 -862
- package/lib/domain/schemas/index.mjs +499 -839
- package/lib/domain/types/index.d.mts +4 -4
- package/lib/domain/types/index.d.ts +4 -4
- package/lib/domain/types/index.js +4 -8
- package/lib/eject/domain/schemas/bullMqWorker.schema.ts +1 -1
- package/lib/producers/index.d.mts +7 -11
- package/lib/producers/index.d.ts +7 -11
- package/lib/producers/index.js +8 -13
- package/lib/producers/index.mjs +4 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { QueueOptions } from 'bullmq';
|
|
2
2
|
|
|
3
3
|
type BullMqWorkerOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
queueOptions: QueueOptions;
|
|
5
|
+
backoffType: 'exponential' | 'fixed';
|
|
6
|
+
retries: number;
|
|
7
|
+
interval: number;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export type { BullMqWorkerOptions };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { QueueOptions } from 'bullmq';
|
|
2
2
|
|
|
3
3
|
type BullMqWorkerOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
queueOptions: QueueOptions;
|
|
5
|
+
backoffType: 'exponential' | 'fixed';
|
|
6
|
+
retries: number;
|
|
7
|
+
interval: number;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export type { BullMqWorkerOptions };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
8
|
for (let key of __getOwnPropNames(from))
|
|
9
9
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, {
|
|
11
|
-
get: () => from[key],
|
|
12
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
-
});
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
11
|
}
|
|
15
12
|
return to;
|
|
16
13
|
};
|
|
17
|
-
var __toCommonJS = (mod) =>
|
|
18
|
-
__copyProps(__defProp({}, '__esModule', { value: true }), mod);
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
15
|
|
|
20
16
|
// domain/types/index.ts
|
|
21
17
|
var types_exports = {};
|
|
@@ -3,17 +3,13 @@ import { WorkerEventEntity } from '@forklaunch/interfaces-worker/types';
|
|
|
3
3
|
import { BullMqWorkerOptions } from '../domain/types/index.mjs';
|
|
4
4
|
import 'bullmq';
|
|
5
5
|
|
|
6
|
-
declare class BullMqWorkerProducer<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
private queue;
|
|
14
|
-
constructor(queueName: string, options: Options);
|
|
15
|
-
enqueueJob(event: EventEntity): Promise<void>;
|
|
16
|
-
enqueueBatchJobs(events: EventEntity[]): Promise<void>;
|
|
6
|
+
declare class BullMqWorkerProducer<EventEntity extends WorkerEventEntity, Options extends BullMqWorkerOptions> implements WorkerProducer<EventEntity> {
|
|
7
|
+
private readonly queueName;
|
|
8
|
+
private readonly options;
|
|
9
|
+
private queue;
|
|
10
|
+
constructor(queueName: string, options: Options);
|
|
11
|
+
enqueueJob(event: EventEntity): Promise<void>;
|
|
12
|
+
enqueueBatchJobs(events: EventEntity[]): Promise<void>;
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
export { BullMqWorkerProducer };
|
package/lib/producers/index.d.ts
CHANGED
|
@@ -3,17 +3,13 @@ import { WorkerEventEntity } from '@forklaunch/interfaces-worker/types';
|
|
|
3
3
|
import { BullMqWorkerOptions } from '../domain/types/index.js';
|
|
4
4
|
import 'bullmq';
|
|
5
5
|
|
|
6
|
-
declare class BullMqWorkerProducer<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
private queue;
|
|
14
|
-
constructor(queueName: string, options: Options);
|
|
15
|
-
enqueueJob(event: EventEntity): Promise<void>;
|
|
16
|
-
enqueueBatchJobs(events: EventEntity[]): Promise<void>;
|
|
6
|
+
declare class BullMqWorkerProducer<EventEntity extends WorkerEventEntity, Options extends BullMqWorkerOptions> implements WorkerProducer<EventEntity> {
|
|
7
|
+
private readonly queueName;
|
|
8
|
+
private readonly options;
|
|
9
|
+
private queue;
|
|
10
|
+
constructor(queueName: string, options: Options);
|
|
11
|
+
enqueueJob(event: EventEntity): Promise<void>;
|
|
12
|
+
enqueueBatchJobs(events: EventEntity[]): Promise<void>;
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
export { BullMqWorkerProducer };
|
package/lib/producers/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -8,18 +8,14 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
13
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, {
|
|
15
|
-
get: () => from[key],
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
19
16
|
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, '__esModule', { value: true }), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
19
|
|
|
24
20
|
// producers/index.ts
|
|
25
21
|
var producers_exports = {};
|
|
@@ -29,7 +25,7 @@ __export(producers_exports, {
|
|
|
29
25
|
module.exports = __toCommonJS(producers_exports);
|
|
30
26
|
|
|
31
27
|
// producers/bullMqWorker.producer.ts
|
|
32
|
-
var import_bullmq = require(
|
|
28
|
+
var import_bullmq = require("bullmq");
|
|
33
29
|
var BullMqWorkerProducer = class {
|
|
34
30
|
constructor(queueName, options) {
|
|
35
31
|
this.queueName = queueName;
|
|
@@ -65,7 +61,6 @@ var BullMqWorkerProducer = class {
|
|
|
65
61
|
}
|
|
66
62
|
};
|
|
67
63
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
-
0 &&
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
BullMqWorkerProducer
|
|
66
|
+
});
|
package/lib/producers/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// producers/bullMqWorker.producer.ts
|
|
2
|
-
import { Queue } from
|
|
2
|
+
import { Queue } from "bullmq";
|
|
3
3
|
var BullMqWorkerProducer = class {
|
|
4
4
|
constructor(queueName, options) {
|
|
5
5
|
this.queueName = queueName;
|
|
@@ -34,4 +34,6 @@ var BullMqWorkerProducer = class {
|
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
export {
|
|
37
|
+
export {
|
|
38
|
+
BullMqWorkerProducer
|
|
39
|
+
};
|
package/package.json
CHANGED