vona-module-a-queue 5.0.13 → 5.0.15
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/.metadata/index.d.ts +22 -14
- package/dist/index.js +19 -20
- package/package.json +1 -1
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
/** startup: begin */
|
|
2
|
-
export * from '../bean/startup.loadQueueWorkers.ts';
|
|
3
|
-
import { type IDecoratorStartupOptions } from 'vona-module-a-startup';
|
|
4
|
-
declare module 'vona-module-a-startup' {
|
|
5
|
-
interface IStartupRecord {
|
|
6
|
-
'a-queue:loadQueueWorkers': IDecoratorStartupOptions;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
declare module 'vona-module-a-queue' {
|
|
10
|
-
interface StartupLoadQueueWorkers {
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/** startup: end */
|
|
14
1
|
/** service: begin */
|
|
15
2
|
export * from '../service/queue.ts';
|
|
16
3
|
import 'vona';
|
|
17
|
-
declare module 'vona-module-a-
|
|
4
|
+
declare module 'vona-module-a-bean' {
|
|
18
5
|
interface IServiceRecord {
|
|
19
6
|
'a-queue:queue': never;
|
|
20
7
|
}
|
|
@@ -22,6 +9,10 @@ declare module 'vona-module-a-web' {
|
|
|
22
9
|
declare module 'vona-module-a-queue' {
|
|
23
10
|
interface ServiceQueue {
|
|
24
11
|
}
|
|
12
|
+
interface ServiceQueue {
|
|
13
|
+
get $beanFullName(): 'a-queue.service.queue';
|
|
14
|
+
get $onionName(): 'a-queue:queue';
|
|
15
|
+
}
|
|
25
16
|
}
|
|
26
17
|
/** service: end */
|
|
27
18
|
/** service: begin */
|
|
@@ -38,6 +29,23 @@ declare module 'vona' {
|
|
|
38
29
|
}
|
|
39
30
|
}
|
|
40
31
|
/** service: end */
|
|
32
|
+
/** startup: begin */
|
|
33
|
+
export * from '../bean/startup.loadQueueWorkers.ts';
|
|
34
|
+
import { type IDecoratorStartupOptions } from 'vona-module-a-startup';
|
|
35
|
+
declare module 'vona-module-a-startup' {
|
|
36
|
+
interface IStartupRecord {
|
|
37
|
+
'a-queue:loadQueueWorkers': IDecoratorStartupOptions;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
declare module 'vona-module-a-queue' {
|
|
41
|
+
interface StartupLoadQueueWorkers {
|
|
42
|
+
}
|
|
43
|
+
interface StartupLoadQueueWorkers {
|
|
44
|
+
get $beanFullName(): 'a-queue.startup.loadQueueWorkers';
|
|
45
|
+
get $onionName(): 'a-queue:loadQueueWorkers';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** startup: end */
|
|
41
49
|
/** config: begin */
|
|
42
50
|
export * from '../config/config.ts';
|
|
43
51
|
import type { config } from '../config/config.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { BeanInfo, BeanBase, uuidv4, deepExtend, instanceDesp, beanFullNameFromOnionName, BeanSimple, BeanScopeBase, createBeanDecorator } from 'vona';
|
|
2
|
-
import { Startup } from 'vona-module-a-startup';
|
|
3
2
|
import * as Bull from 'bullmq';
|
|
4
|
-
import { Service } from 'vona-module-a-
|
|
5
|
-
import {
|
|
3
|
+
import { Service, Scope } from 'vona-module-a-bean';
|
|
4
|
+
import { Startup } from 'vona-module-a-startup';
|
|
6
5
|
|
|
7
6
|
var _dec$2, _dec2$2, _class$2;
|
|
8
|
-
let
|
|
9
|
-
instance: true,
|
|
10
|
-
after: true
|
|
11
|
-
}), _dec2$2 = BeanInfo({
|
|
12
|
-
module: "a-queue"
|
|
13
|
-
}), _dec$2(_class$2 = _dec2$2(_class$2 = class StartupLoadQueueWorkers extends BeanBase {
|
|
14
|
-
async execute() {
|
|
15
|
-
// load queue workers
|
|
16
|
-
if (!this.app.meta.isTest) {
|
|
17
|
-
this.scope.service.queue.loadQueueWorkers(this.ctx.instanceName);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}) || _class$2) || _class$2);
|
|
21
|
-
|
|
22
|
-
var _dec$1, _dec2$1, _class$1;
|
|
23
|
-
let ServiceQueue = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
7
|
+
let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
24
8
|
module: "a-queue"
|
|
25
|
-
}), _dec$
|
|
9
|
+
}), _dec$2(_class$2 = _dec2$2(_class$2 = class ServiceQueue extends BeanBase {
|
|
26
10
|
constructor(...args) {
|
|
27
11
|
super(...args);
|
|
28
12
|
this._workers = {};
|
|
@@ -283,6 +267,21 @@ let ServiceQueue = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
283
267
|
options
|
|
284
268
|
};
|
|
285
269
|
}
|
|
270
|
+
}) || _class$2) || _class$2);
|
|
271
|
+
|
|
272
|
+
var _dec$1, _dec2$1, _class$1;
|
|
273
|
+
let StartupLoadQueueWorkers = (_dec$1 = Startup({
|
|
274
|
+
instance: true,
|
|
275
|
+
after: true
|
|
276
|
+
}), _dec2$1 = BeanInfo({
|
|
277
|
+
module: "a-queue"
|
|
278
|
+
}), _dec$1(_class$1 = _dec2$1(_class$1 = class StartupLoadQueueWorkers extends BeanBase {
|
|
279
|
+
async execute() {
|
|
280
|
+
// load queue workers
|
|
281
|
+
if (!this.app.meta.isTest) {
|
|
282
|
+
this.scope.service.queue.loadQueueWorkers(this.ctx.instanceName);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
286
285
|
}) || _class$1) || _class$1);
|
|
287
286
|
|
|
288
287
|
function config(_app) {
|