@nest-omni/core 2.0.1-11 → 2.0.1-12

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.
@@ -0,0 +1,14 @@
1
+ export declare function WorkerProcessor(queueName?: string): ClassDecorator;
2
+ export declare function WorkerProcess(name?: string): MethodDecorator;
3
+ export declare function WorkerOnQueueActive(): MethodDecorator;
4
+ export declare function WorkerOnQueueCompleted(): MethodDecorator;
5
+ export declare function WorkerOnQueueProgress(): MethodDecorator;
6
+ export declare function WorkerOnQueueFailed(): MethodDecorator;
7
+ export declare function WorkerOnQueueError(): MethodDecorator;
8
+ export declare function WorkerOnQueueWaiting(): MethodDecorator;
9
+ export declare function WorkerOnQueueStalled(): MethodDecorator;
10
+ export declare function WorkerOnQueueRemoved(): MethodDecorator;
11
+ export declare function WorkerOnQueueCleaned(): MethodDecorator;
12
+ export declare function WorkerOnQueueDrained(): MethodDecorator;
13
+ export declare function WorkerOnQueuePaused(): MethodDecorator;
14
+ export declare function WorkerOnQueueResumed(): MethodDecorator;
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkerProcessor = WorkerProcessor;
4
+ exports.WorkerProcess = WorkerProcess;
5
+ exports.WorkerOnQueueActive = WorkerOnQueueActive;
6
+ exports.WorkerOnQueueCompleted = WorkerOnQueueCompleted;
7
+ exports.WorkerOnQueueProgress = WorkerOnQueueProgress;
8
+ exports.WorkerOnQueueFailed = WorkerOnQueueFailed;
9
+ exports.WorkerOnQueueError = WorkerOnQueueError;
10
+ exports.WorkerOnQueueWaiting = WorkerOnQueueWaiting;
11
+ exports.WorkerOnQueueStalled = WorkerOnQueueStalled;
12
+ exports.WorkerOnQueueRemoved = WorkerOnQueueRemoved;
13
+ exports.WorkerOnQueueCleaned = WorkerOnQueueCleaned;
14
+ exports.WorkerOnQueueDrained = WorkerOnQueueDrained;
15
+ exports.WorkerOnQueuePaused = WorkerOnQueuePaused;
16
+ exports.WorkerOnQueueResumed = WorkerOnQueueResumed;
17
+ const bull_1 = require("@nestjs/bull");
18
+ const mode_setup_1 = require("./mode.setup");
19
+ function WorkerProcessor(queueName) {
20
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
21
+ return (0, bull_1.Processor)(queueName);
22
+ }
23
+ return function (constructor) {
24
+ return constructor;
25
+ };
26
+ }
27
+ function WorkerProcess(name) {
28
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
29
+ return (0, bull_1.Process)(name);
30
+ }
31
+ return function (target, propertyKey, descriptor) {
32
+ return descriptor;
33
+ };
34
+ }
35
+ function WorkerOnQueueActive() {
36
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
37
+ return (0, bull_1.OnQueueActive)();
38
+ }
39
+ return function (target, propertyKey, descriptor) {
40
+ return descriptor;
41
+ };
42
+ }
43
+ function WorkerOnQueueCompleted() {
44
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
45
+ return (0, bull_1.OnQueueCompleted)();
46
+ }
47
+ return function (target, propertyKey, descriptor) {
48
+ return descriptor;
49
+ };
50
+ }
51
+ function WorkerOnQueueProgress() {
52
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
53
+ return (0, bull_1.OnQueueProgress)();
54
+ }
55
+ return function (target, propertyKey, descriptor) {
56
+ return descriptor;
57
+ };
58
+ }
59
+ function WorkerOnQueueFailed() {
60
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
61
+ return (0, bull_1.OnQueueFailed)();
62
+ }
63
+ return function (target, propertyKey, descriptor) {
64
+ return descriptor;
65
+ };
66
+ }
67
+ function WorkerOnQueueError() {
68
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
69
+ return (0, bull_1.OnQueueError)();
70
+ }
71
+ return function (target, propertyKey, descriptor) {
72
+ return descriptor;
73
+ };
74
+ }
75
+ function WorkerOnQueueWaiting() {
76
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
77
+ return (0, bull_1.OnQueueWaiting)();
78
+ }
79
+ return function (target, propertyKey, descriptor) {
80
+ return descriptor;
81
+ };
82
+ }
83
+ function WorkerOnQueueStalled() {
84
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
85
+ return (0, bull_1.OnQueueStalled)();
86
+ }
87
+ return function (target, propertyKey, descriptor) {
88
+ return descriptor;
89
+ };
90
+ }
91
+ function WorkerOnQueueRemoved() {
92
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
93
+ return (0, bull_1.OnQueueRemoved)();
94
+ }
95
+ return function (target, propertyKey, descriptor) {
96
+ return descriptor;
97
+ };
98
+ }
99
+ function WorkerOnQueueCleaned() {
100
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
101
+ return (0, bull_1.OnQueueCleaned)();
102
+ }
103
+ return function (target, propertyKey, descriptor) {
104
+ return descriptor;
105
+ };
106
+ }
107
+ function WorkerOnQueueDrained() {
108
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
109
+ return (0, bull_1.OnQueueDrained)();
110
+ }
111
+ return function (target, propertyKey, descriptor) {
112
+ return descriptor;
113
+ };
114
+ }
115
+ function WorkerOnQueuePaused() {
116
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
117
+ return (0, bull_1.OnQueuePaused)();
118
+ }
119
+ return function (target, propertyKey, descriptor) {
120
+ return descriptor;
121
+ };
122
+ }
123
+ function WorkerOnQueueResumed() {
124
+ if ((0, mode_setup_1.shouldProcessQueues)()) {
125
+ return (0, bull_1.OnQueueResumed)();
126
+ }
127
+ return function (target, propertyKey, descriptor) {
128
+ return descriptor;
129
+ };
130
+ }