@pikku/queue-bullmq 0.11.1 → 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,5 +1,19 @@
|
|
|
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
|
+
|
|
3
17
|
## 0.11.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -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 {
|
|
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
|
|
@@ -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, createWireServices?: CreateWireServices
|
|
22
|
+
constructor(redisConnectionOptions: ConnectionOptions, singletonServices: CoreSingletonServices, createWireServices?: CreateWireServices | undefined);
|
|
23
23
|
/**
|
|
24
24
|
* Scan state and register all compatible processors
|
|
25
25
|
*/
|
|
@@ -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 {
|
|
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, createWireServices?: CreateWireServices
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/queue-bullmq",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"release": "npm run build && npm test"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@pikku/core": "^0.11.
|
|
16
|
+
"@pikku/core": "^0.11.2"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"bullmq": "^5.63.2",
|
package/src/bull-queue-worker.ts
CHANGED
|
@@ -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
|
-
CreateWireServices,
|
|
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 createWireServices?: CreateWireServices
|
|
149
|
-
CoreSingletonServices,
|
|
150
|
-
CoreServices,
|
|
151
|
-
any
|
|
152
|
-
>
|
|
144
|
+
private createWireServices?: CreateWireServices
|
|
153
145
|
) {}
|
|
154
146
|
|
|
155
147
|
/**
|
|
@@ -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
|
-
CreateWireServices,
|
|
9
|
-
} from '@pikku/core'
|
|
5
|
+
import type { CoreSingletonServices, CreateWireServices } from '@pikku/core'
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* Factory class for BullMQ services
|
|
@@ -41,11 +37,7 @@ export class BullServiceFactory {
|
|
|
41
37
|
*/
|
|
42
38
|
getQueueWorkers(
|
|
43
39
|
singletonServices: CoreSingletonServices,
|
|
44
|
-
createWireServices?: CreateWireServices
|
|
45
|
-
CoreSingletonServices,
|
|
46
|
-
CoreServices,
|
|
47
|
-
any
|
|
48
|
-
>
|
|
40
|
+
createWireServices?: CreateWireServices
|
|
49
41
|
): BullQueueWorkers {
|
|
50
42
|
if (!this.queueWorkers) {
|
|
51
43
|
this.queueWorkers = new BullQueueWorkers(
|
|
@@ -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
|
}
|