@forklaunch/implementation-worker-redis 1.0.19 → 1.0.21
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.js +24 -15
- package/lib/consumers/index.mjs +13 -11
- package/lib/domain/schemas/index.js +641 -588
- package/lib/domain/schemas/index.mjs +599 -587
- package/lib/domain/types/index.js +8 -4
- package/lib/producers/index.js +12 -7
- package/lib/producers/index.mjs +1 -3
- package/package.json +6 -6
package/lib/consumers/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,14 +8,18 @@ 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 (from && typeof from ===
|
|
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, {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
15
18
|
}
|
|
16
19
|
return to;
|
|
17
20
|
};
|
|
18
|
-
var __toCommonJS = (mod) =>
|
|
21
|
+
var __toCommonJS = (mod) =>
|
|
22
|
+
__copyProps(__defProp({}, '__esModule', { value: true }), mod);
|
|
19
23
|
|
|
20
24
|
// consumers/index.ts
|
|
21
25
|
var consumers_exports = {};
|
|
@@ -39,19 +43,23 @@ var RedisWorkerConsumer = class {
|
|
|
39
43
|
this.failureHandler = failureHandler;
|
|
40
44
|
}
|
|
41
45
|
async retrieveEvents() {
|
|
42
|
-
const events = (
|
|
43
|
-
this.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
const events = (
|
|
47
|
+
await this.cache.dequeueBatchRecords(
|
|
48
|
+
this.queueName,
|
|
49
|
+
this.options.pageSize
|
|
50
|
+
)
|
|
51
|
+
).filter((event) => event != null);
|
|
46
52
|
return events;
|
|
47
53
|
}
|
|
48
54
|
async updateEvents(events) {
|
|
49
55
|
await this.cache.enqueueBatchRecords(
|
|
50
56
|
this.queueName,
|
|
51
|
-
events
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
events
|
|
58
|
+
.filter((event) => event != null && event.retryCount <= 3)
|
|
59
|
+
.map((event) => ({
|
|
60
|
+
...event,
|
|
61
|
+
retryCount: event.retryCount + 1
|
|
62
|
+
}))
|
|
55
63
|
);
|
|
56
64
|
}
|
|
57
65
|
async peekEvents() {
|
|
@@ -71,6 +79,7 @@ var RedisWorkerConsumer = class {
|
|
|
71
79
|
}
|
|
72
80
|
};
|
|
73
81
|
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
-
0 &&
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
0 &&
|
|
83
|
+
(module.exports = {
|
|
84
|
+
RedisWorkerConsumer
|
|
85
|
+
});
|
package/lib/consumers/index.mjs
CHANGED
|
@@ -13,19 +13,23 @@ var RedisWorkerConsumer = class {
|
|
|
13
13
|
this.failureHandler = failureHandler;
|
|
14
14
|
}
|
|
15
15
|
async retrieveEvents() {
|
|
16
|
-
const events = (
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const events = (
|
|
17
|
+
await this.cache.dequeueBatchRecords(
|
|
18
|
+
this.queueName,
|
|
19
|
+
this.options.pageSize
|
|
20
|
+
)
|
|
21
|
+
).filter((event) => event != null);
|
|
20
22
|
return events;
|
|
21
23
|
}
|
|
22
24
|
async updateEvents(events) {
|
|
23
25
|
await this.cache.enqueueBatchRecords(
|
|
24
26
|
this.queueName,
|
|
25
|
-
events
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
events
|
|
28
|
+
.filter((event) => event != null && event.retryCount <= 3)
|
|
29
|
+
.map((event) => ({
|
|
30
|
+
...event,
|
|
31
|
+
retryCount: event.retryCount + 1
|
|
32
|
+
}))
|
|
29
33
|
);
|
|
30
34
|
}
|
|
31
35
|
async peekEvents() {
|
|
@@ -44,6 +48,4 @@ var RedisWorkerConsumer = class {
|
|
|
44
48
|
}, this.options.interval);
|
|
45
49
|
}
|
|
46
50
|
};
|
|
47
|
-
export {
|
|
48
|
-
RedisWorkerConsumer
|
|
49
|
-
};
|
|
51
|
+
export { RedisWorkerConsumer };
|