@pikku/queue-bullmq 0.11.0 → 0.11.2

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/CHANGELOG.md CHANGED
@@ -1,11 +1,38 @@
1
1
  ## 0.11.0
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - db9c7bf: Simplify CreateWireServices type signature for custom Config compatibility
8
+ - Updated dependencies [db9c7bf]
9
+ - @pikku/core@0.11.2
10
+
11
+ ## 0.11.2
12
+
13
+ ### Fixes
14
+
15
+ - ddd87eaf: Simplify CreateWireServices type signature for custom Config compatibility
16
+
17
+ ## 0.11.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 4b811db: chore: updating all dependencies
22
+ - 06e1a31: breaking: change session services to wire services
23
+ - Updated dependencies [4b811db]
24
+ - Updated dependencies [e12a00c]
25
+ - Updated dependencies [4579434]
26
+ - Updated dependencies [28aeb7f]
27
+ - Updated dependencies [ce902b1]
28
+ - Updated dependencies [06e1a31]
29
+ - @pikku/core@0.11.1
30
+
3
31
  ### Minor Changes
4
32
 
5
33
  - Add scheduler service implementation
6
34
  - Add service factory for queue and scheduler creation
7
35
 
8
-
9
36
  # @pikku/queue-bullmq
10
37
 
11
38
  ## 0.10.0
@@ -1,6 +1,6 @@
1
1
  import { ConnectionOptions, WorkerOptions } from 'bullmq';
2
2
  import type { QueueWorkers, PikkuWorkerConfig, QueueConfigMapping, ConfigValidationResult } from '@pikku/core/queue';
3
- import type { CoreServices, CoreSingletonServices, CreateSessionServices } from '@pikku/core';
3
+ import type { CoreSingletonServices, CreateWireServices } from '@pikku/core';
4
4
  export declare const mapPikkuWorkerToBull: (workerConfig?: PikkuWorkerConfig) => Omit<WorkerOptions, "connection">;
5
5
  /**
6
6
  * Bull/Redis queue service implementation
@@ -9,7 +9,7 @@ export declare const mapPikkuWorkerToBull: (workerConfig?: PikkuWorkerConfig) =>
9
9
  export declare class BullQueueWorkers implements QueueWorkers {
10
10
  private redisConnectionOptions;
11
11
  private singletonServices;
12
- private createSessionServices?;
12
+ private createWireServices?;
13
13
  readonly name = "bull";
14
14
  readonly supportsResults = true;
15
15
  /**
@@ -19,7 +19,7 @@ export declare class BullQueueWorkers implements QueueWorkers {
19
19
  readonly configMappings: QueueConfigMapping;
20
20
  private workers;
21
21
  private queueEvents;
22
- constructor(redisConnectionOptions: ConnectionOptions, singletonServices: CoreSingletonServices, createSessionServices?: CreateSessionServices<CoreSingletonServices, CoreServices, any> | undefined);
22
+ constructor(redisConnectionOptions: ConnectionOptions, singletonServices: CoreSingletonServices, createWireServices?: CreateWireServices | undefined);
23
23
  /**
24
24
  * Scan state and register all compatible processors
25
25
  */
@@ -38,7 +38,7 @@ export const mapPikkuWorkerToBull = (workerConfig) => {
38
38
  export class BullQueueWorkers {
39
39
  redisConnectionOptions;
40
40
  singletonServices;
41
- createSessionServices;
41
+ createWireServices;
42
42
  name = 'bull';
43
43
  supportsResults = true;
44
44
  /**
@@ -101,10 +101,10 @@ export class BullQueueWorkers {
101
101
  };
102
102
  workers = new Map();
103
103
  queueEvents = new Map();
104
- constructor(redisConnectionOptions, singletonServices, createSessionServices) {
104
+ constructor(redisConnectionOptions, singletonServices, createWireServices) {
105
105
  this.redisConnectionOptions = redisConnectionOptions;
106
106
  this.singletonServices = singletonServices;
107
- this.createSessionServices = createSessionServices;
107
+ this.createWireServices = createWireServices;
108
108
  }
109
109
  /**
110
110
  * Scan state and register all compatible processors
@@ -115,7 +115,7 @@ export class BullQueueWorkers {
115
115
  try {
116
116
  return await runQueueJob({
117
117
  singletonServices: this.singletonServices,
118
- createSessionServices: this.createSessionServices,
118
+ createWireServices: this.createWireServices,
119
119
  job: await mapBullJobToQueueJob(job, this.redisConnectionOptions, this.queueEvents),
120
120
  updateProgress: async (progress) => {
121
121
  await job.updateProgress(progress);
@@ -2,7 +2,7 @@ import { ConnectionOptions } from 'bullmq';
2
2
  import { BullQueueService } from './bull-queue-service.js';
3
3
  import { BullQueueWorkers } from './bull-queue-worker.js';
4
4
  import { BullSchedulerService } from './bull-scheduler-service.js';
5
- import type { CoreServices, CoreSingletonServices, CreateSessionServices } from '@pikku/core';
5
+ import type { CoreSingletonServices, CreateWireServices } from '@pikku/core';
6
6
  /**
7
7
  * Factory class for BullMQ services
8
8
  * Manages Redis connection options shared across queue, worker, and scheduler services
@@ -24,7 +24,7 @@ export declare class BullServiceFactory {
24
24
  /**
25
25
  * Get the queue workers for processing jobs
26
26
  */
27
- getQueueWorkers(singletonServices: CoreSingletonServices, createSessionServices?: CreateSessionServices<CoreSingletonServices, CoreServices, any>): BullQueueWorkers;
27
+ getQueueWorkers(singletonServices: CoreSingletonServices, createWireServices?: CreateWireServices): BullQueueWorkers;
28
28
  /**
29
29
  * Get the scheduler service for managing delayed tasks
30
30
  */
@@ -33,4 +33,8 @@ export declare class BullServiceFactory {
33
33
  * Close all services
34
34
  */
35
35
  close(): Promise<void>;
36
+ /**
37
+ * Alias for close() - used by stopSingletonServices
38
+ */
39
+ stop(): Promise<void>;
36
40
  }
@@ -31,9 +31,9 @@ export class BullServiceFactory {
31
31
  /**
32
32
  * Get the queue workers for processing jobs
33
33
  */
34
- getQueueWorkers(singletonServices, createSessionServices) {
34
+ getQueueWorkers(singletonServices, createWireServices) {
35
35
  if (!this.queueWorkers) {
36
- this.queueWorkers = new BullQueueWorkers(this.redisConnectionOptions, singletonServices, createSessionServices);
36
+ this.queueWorkers = new BullQueueWorkers(this.redisConnectionOptions, singletonServices, createWireServices);
37
37
  }
38
38
  return this.queueWorkers;
39
39
  }
@@ -62,4 +62,10 @@ export class BullServiceFactory {
62
62
  }
63
63
  await Promise.all(closePromises);
64
64
  }
65
+ /**
66
+ * Alias for close() - used by stopSingletonServices
67
+ */
68
+ async stop() {
69
+ await this.close();
70
+ }
65
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/queue-bullmq",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -13,10 +13,10 @@
13
13
  "release": "npm run build && npm test"
14
14
  },
15
15
  "peerDependencies": {
16
- "@pikku/core": "^0.11.0"
16
+ "@pikku/core": "^0.11.2"
17
17
  },
18
18
  "dependencies": {
19
- "bullmq": "^5.61.0",
19
+ "bullmq": "^5.63.2",
20
20
  "ioredis": "^5.8.2"
21
21
  },
22
22
  "devDependencies": {
@@ -16,11 +16,7 @@ import {
16
16
  QueueJobFailedError,
17
17
  QueueJobDiscardedError,
18
18
  } from '@pikku/core/queue'
19
- import type {
20
- CoreServices,
21
- CoreSingletonServices,
22
- CreateSessionServices,
23
- } from '@pikku/core'
19
+ import type { CoreSingletonServices, CreateWireServices } from '@pikku/core'
24
20
  import { mapBullJobToQueueJob } from './utils.js'
25
21
 
26
22
  export const mapPikkuWorkerToBull = (
@@ -145,11 +141,7 @@ export class BullQueueWorkers implements QueueWorkers {
145
141
  constructor(
146
142
  private redisConnectionOptions: ConnectionOptions,
147
143
  private singletonServices: CoreSingletonServices,
148
- private createSessionServices?: CreateSessionServices<
149
- CoreSingletonServices,
150
- CoreServices,
151
- any
152
- >
144
+ private createWireServices?: CreateWireServices
153
145
  ) {}
154
146
 
155
147
  /**
@@ -166,7 +158,7 @@ export class BullQueueWorkers implements QueueWorkers {
166
158
  try {
167
159
  return await runQueueJob({
168
160
  singletonServices: this.singletonServices,
169
- createSessionServices: this.createSessionServices,
161
+ createWireServices: this.createWireServices,
170
162
  job: await mapBullJobToQueueJob(
171
163
  job,
172
164
  this.redisConnectionOptions,
@@ -2,11 +2,7 @@ import { ConnectionOptions } from 'bullmq'
2
2
  import { BullQueueService } from './bull-queue-service.js'
3
3
  import { BullQueueWorkers } from './bull-queue-worker.js'
4
4
  import { BullSchedulerService } from './bull-scheduler-service.js'
5
- import type {
6
- CoreServices,
7
- CoreSingletonServices,
8
- CreateSessionServices,
9
- } from '@pikku/core'
5
+ import type { CoreSingletonServices, CreateWireServices } from '@pikku/core'
10
6
 
11
7
  /**
12
8
  * Factory class for BullMQ services
@@ -41,17 +37,13 @@ export class BullServiceFactory {
41
37
  */
42
38
  getQueueWorkers(
43
39
  singletonServices: CoreSingletonServices,
44
- createSessionServices?: CreateSessionServices<
45
- CoreSingletonServices,
46
- CoreServices,
47
- any
48
- >
40
+ createWireServices?: CreateWireServices
49
41
  ): BullQueueWorkers {
50
42
  if (!this.queueWorkers) {
51
43
  this.queueWorkers = new BullQueueWorkers(
52
44
  this.redisConnectionOptions,
53
45
  singletonServices,
54
- createSessionServices
46
+ createWireServices
55
47
  )
56
48
  }
57
49
  return this.queueWorkers
@@ -89,4 +81,11 @@ export class BullServiceFactory {
89
81
 
90
82
  await Promise.all(closePromises)
91
83
  }
84
+
85
+ /**
86
+ * Alias for close() - used by stopSingletonServices
87
+ */
88
+ async stop(): Promise<void> {
89
+ await this.close()
90
+ }
92
91
  }