vona-module-a-queue 5.0.29 → 5.0.31

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.
@@ -8,7 +8,6 @@ export type TypeQueue<%=argv.beanNameCapitalize%>JobResult = void;
8
8
  @Queue()
9
9
  export class Queue<%=argv.beanNameCapitalize%>
10
10
  extends BeanQueueBase<TypeQueue<%=argv.beanNameCapitalize%>JobData, TypeQueue<%=argv.beanNameCapitalize%>JobResult>
11
- implements IQueueExecute<TypeQueue<%=argv.beanNameCapitalize%>JobData, TypeQueue<%=argv.beanNameCapitalize%>JobResult>
12
- {
11
+ implements IQueueExecute<TypeQueue<%=argv.beanNameCapitalize%>JobData, TypeQueue<%=argv.beanNameCapitalize%>JobResult> {
13
12
  async execute(_data: TypeQueue<%=argv.beanNameCapitalize%>JobData, _options?: IQueuePushOptions): Promise<TypeQueue<%=argv.beanNameCapitalize%>JobResult> {}
14
13
  }
@@ -47,6 +47,23 @@ declare module 'vona-module-a-queue' {
47
47
  }
48
48
  }
49
49
  /** startup: end */
50
+ /** hmr: begin */
51
+ export * from '../bean/hmr.queue.ts';
52
+ import 'vona';
53
+ declare module 'vona' {
54
+ interface IHmrRecord {
55
+ 'a-queue:queue': never;
56
+ }
57
+ }
58
+ declare module 'vona-module-a-queue' {
59
+ interface HmrQueue {
60
+ }
61
+ interface HmrQueue {
62
+ get $beanFullName(): 'a-queue.hmr.queue';
63
+ get $onionName(): 'a-queue:queue';
64
+ }
65
+ }
66
+ /** hmr: end */
50
67
  /** config: begin */
51
68
  export * from '../config/config.ts';
52
69
  import type { config } from '../config/config.ts';
@@ -0,0 +1,6 @@
1
+ import type { IDecoratorBeanOptionsBase } from 'vona';
2
+ import type { IHmrReload } from 'vona-module-a-hmr';
3
+ import { BeanBase } from 'vona';
4
+ export declare class HmrQueue extends BeanBase implements IHmrReload {
5
+ reload(_beanOptions: IDecoratorBeanOptionsBase): Promise<void>;
6
+ }
package/dist/index.js CHANGED
@@ -4,11 +4,12 @@ import * as Bull from 'bullmq';
4
4
  import { Service, Scope } from 'vona-module-a-bean';
5
5
  import { getRedisClientKeyPrefix } from 'vona-module-a-redis';
6
6
  import { Startup } from 'vona-module-a-startup';
7
+ import { Hmr } from 'vona-module-a-hmr';
7
8
 
8
- var _dec$2, _dec2$2, _class$2;
9
- let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
9
+ var _dec$3, _dec2$3, _class$3;
10
+ let ServiceQueue = (_dec$3 = Service(), _dec2$3 = BeanInfo({
10
11
  module: "a-queue"
11
- }), _dec$2(_class$2 = _dec2$2(_class$2 = class ServiceQueue extends BeanBase {
12
+ }), _dec$3(_class$3 = _dec2$3(_class$3 = class ServiceQueue extends BeanBase {
12
13
  constructor(...args) {
13
14
  super(...args);
14
15
  this._workers = {};
@@ -26,7 +27,7 @@ let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
26
27
  return this._queuePush(info, true);
27
28
  }
28
29
  loadQueueWorkers(instanceName) {
29
- for (const queueItem of this.bean.onion.queue.getOnionsEnabled()) {
30
+ for (const queueItem of this.bean.onion.queue.getOnionsEnabledCached()) {
30
31
  const info = {
31
32
  queueName: queueItem.name,
32
33
  data: undefined,
@@ -287,21 +288,30 @@ let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
287
288
  options
288
289
  };
289
290
  }
290
- }) || _class$2) || _class$2);
291
+ }) || _class$3) || _class$3);
291
292
 
292
- var _dec$1, _dec2$1, _class$1;
293
- let StartupLoadQueueWorkers = (_dec$1 = Startup({
293
+ var _dec$2, _dec2$2, _class$2;
294
+ let StartupLoadQueueWorkers = (_dec$2 = Startup({
294
295
  instance: true,
295
296
  after: true
296
- }), _dec2$1 = BeanInfo({
297
+ }), _dec2$2 = BeanInfo({
297
298
  module: "a-queue"
298
- }), _dec$1(_class$1 = _dec2$1(_class$1 = class StartupLoadQueueWorkers extends BeanBase {
299
+ }), _dec$2(_class$2 = _dec2$2(_class$2 = class StartupLoadQueueWorkers extends BeanBase {
299
300
  async execute() {
300
301
  // load queue workers
301
302
  if (!this.app.meta.isTest) {
302
303
  this.scope.service.queue.loadQueueWorkers(this.ctx.instanceName);
303
304
  }
304
305
  }
306
+ }) || _class$2) || _class$2);
307
+
308
+ var _dec$1, _dec2$1, _class$1;
309
+ let HmrQueue = (_dec$1 = Hmr(), _dec2$1 = BeanInfo({
310
+ module: "a-queue"
311
+ }), _dec$1(_class$1 = _dec2$1(_class$1 = class HmrQueue extends BeanBase {
312
+ async reload(_beanOptions) {
313
+ this.app.bean.worker.reload();
314
+ }
305
315
  }) || _class$1) || _class$1);
306
316
 
307
317
  function config(_app) {
@@ -353,4 +363,4 @@ function Queue(options) {
353
363
  return createBeanDecorator('queue', options);
354
364
  }
355
365
 
356
- export { BeanQueueBase, Monkey, Queue, ScopeModuleAQueue, ServiceQueue, StartupLoadQueueWorkers, config };
366
+ export { BeanQueueBase, HmrQueue, Monkey, Queue, ScopeModuleAQueue, ServiceQueue, StartupLoadQueueWorkers, config };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-queue",
3
3
  "type": "module",
4
- "version": "5.0.29",
4
+ "version": "5.0.31",
5
5
  "title": "a-queue",
6
6
  "vonaModule": {
7
7
  "dependencies": {},