atomic-queues 1.4.1 → 1.6.0
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/README.md +300 -283
- package/dist/decorators/constants.d.ts +17 -0
- package/dist/decorators/constants.d.ts.map +1 -0
- package/dist/decorators/constants.js +23 -0
- package/dist/decorators/constants.js.map +1 -0
- package/dist/decorators/entity.decorators.d.ts +88 -0
- package/dist/decorators/entity.decorators.d.ts.map +1 -0
- package/dist/decorators/entity.decorators.js +150 -0
- package/dist/decorators/entity.decorators.js.map +1 -0
- package/dist/decorators/index.d.ts +9 -1
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +9 -1
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/interfaces.d.ts +130 -0
- package/dist/decorators/interfaces.d.ts.map +1 -0
- package/dist/decorators/interfaces.js +3 -0
- package/dist/decorators/interfaces.js.map +1 -0
- package/dist/decorators/job.decorators.d.ts +60 -0
- package/dist/decorators/job.decorators.d.ts.map +1 -0
- package/dist/decorators/job.decorators.js +97 -0
- package/dist/decorators/job.decorators.js.map +1 -0
- package/dist/decorators/legacy.decorators.d.ts +36 -0
- package/dist/decorators/legacy.decorators.d.ts.map +1 -0
- package/dist/decorators/legacy.decorators.js +61 -0
- package/dist/decorators/legacy.decorators.js.map +1 -0
- package/dist/decorators/metadata-readers.d.ts +31 -0
- package/dist/decorators/metadata-readers.d.ts.map +1 -0
- package/dist/decorators/metadata-readers.js +53 -0
- package/dist/decorators/metadata-readers.js.map +1 -0
- package/dist/decorators/registry.d.ts +2 -0
- package/dist/decorators/registry.d.ts.map +1 -0
- package/dist/decorators/registry.js +6 -0
- package/dist/decorators/registry.js.map +1 -0
- package/dist/decorators/scaler.decorators.d.ts +65 -0
- package/dist/decorators/scaler.decorators.d.ts.map +1 -0
- package/dist/decorators/scaler.decorators.js +103 -0
- package/dist/decorators/scaler.decorators.js.map +1 -0
- package/dist/decorators/type-guards.d.ts +18 -0
- package/dist/decorators/type-guards.d.ts.map +1 -0
- package/dist/decorators/type-guards.js +32 -0
- package/dist/decorators/type-guards.js.map +1 -0
- package/dist/decorators/utils.d.ts +20 -0
- package/dist/decorators/utils.d.ts.map +1 -0
- package/dist/decorators/utils.js +98 -0
- package/dist/decorators/utils.js.map +1 -0
- package/dist/decorators/worker.decorators.d.ts +58 -0
- package/dist/decorators/worker.decorators.d.ts.map +1 -0
- package/dist/decorators/worker.decorators.js +92 -0
- package/dist/decorators/worker.decorators.js.map +1 -0
- package/dist/domain/interfaces/config.interfaces.d.ts +188 -0
- package/dist/domain/interfaces/config.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/config.interfaces.js +3 -0
- package/dist/domain/interfaces/config.interfaces.js.map +1 -0
- package/dist/domain/interfaces/cqrs.interfaces.d.ts +7 -0
- package/dist/domain/interfaces/cqrs.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/cqrs.interfaces.js +3 -0
- package/dist/domain/interfaces/cqrs.interfaces.js.map +1 -0
- package/dist/domain/interfaces/event.interfaces.d.ts +71 -0
- package/dist/domain/interfaces/event.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/event.interfaces.js +3 -0
- package/dist/domain/interfaces/event.interfaces.js.map +1 -0
- package/dist/domain/interfaces/index-tracking.interfaces.d.ts +69 -0
- package/dist/domain/interfaces/index-tracking.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/index-tracking.interfaces.js +3 -0
- package/dist/domain/interfaces/index-tracking.interfaces.js.map +1 -0
- package/dist/domain/interfaces/index.d.ts +12 -0
- package/dist/domain/interfaces/index.d.ts.map +1 -0
- package/dist/domain/interfaces/index.js +28 -0
- package/dist/domain/interfaces/index.js.map +1 -0
- package/dist/domain/interfaces/job.interfaces.d.ts +76 -0
- package/dist/domain/interfaces/job.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/job.interfaces.js +3 -0
- package/dist/domain/interfaces/job.interfaces.js.map +1 -0
- package/dist/domain/interfaces/lock.interfaces.d.ts +54 -0
- package/dist/domain/interfaces/lock.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/lock.interfaces.js +3 -0
- package/dist/domain/interfaces/lock.interfaces.js.map +1 -0
- package/dist/domain/interfaces/process.interfaces.d.ts +44 -0
- package/dist/domain/interfaces/process.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/process.interfaces.js +3 -0
- package/dist/domain/interfaces/process.interfaces.js.map +1 -0
- package/dist/domain/interfaces/queue.interfaces.d.ts +46 -0
- package/dist/domain/interfaces/queue.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/queue.interfaces.js +3 -0
- package/dist/domain/interfaces/queue.interfaces.js.map +1 -0
- package/dist/domain/interfaces/scaling.interfaces.d.ts +62 -0
- package/dist/domain/interfaces/scaling.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/scaling.interfaces.js +3 -0
- package/dist/domain/interfaces/scaling.interfaces.js.map +1 -0
- package/dist/domain/interfaces/utility.types.d.ts +15 -0
- package/dist/domain/interfaces/utility.types.d.ts.map +1 -0
- package/dist/domain/interfaces/utility.types.js +3 -0
- package/dist/domain/interfaces/utility.types.js.map +1 -0
- package/dist/domain/interfaces/worker.interfaces.d.ts +120 -0
- package/dist/domain/interfaces/worker.interfaces.d.ts.map +1 -0
- package/dist/domain/interfaces/worker.interfaces.js +3 -0
- package/dist/domain/interfaces/worker.interfaces.js.map +1 -0
- package/dist/module/atomic-queues.module.d.ts.map +1 -1
- package/dist/module/atomic-queues.module.js +5 -0
- package/dist/module/atomic-queues.module.js.map +1 -1
- package/dist/services/cron-manager/cron-manager.service.d.ts +5 -4
- package/dist/services/cron-manager/cron-manager.service.d.ts.map +1 -1
- package/dist/services/cron-manager/cron-manager.service.js +26 -57
- package/dist/services/cron-manager/cron-manager.service.js.map +1 -1
- package/dist/services/index-manager/index-manager.service.d.ts +0 -4
- package/dist/services/index-manager/index-manager.service.d.ts.map +1 -1
- package/dist/services/index-manager/index-manager.service.js +4 -16
- package/dist/services/index-manager/index-manager.service.js.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/processor-discovery/decorator-discovery.service.d.ts +40 -0
- package/dist/services/processor-discovery/decorator-discovery.service.d.ts.map +1 -0
- package/dist/services/processor-discovery/decorator-discovery.service.js +191 -0
- package/dist/services/processor-discovery/decorator-discovery.service.js.map +1 -0
- package/dist/services/processor-discovery/index.d.ts +4 -0
- package/dist/services/processor-discovery/index.d.ts.map +1 -1
- package/dist/services/processor-discovery/index.js +4 -0
- package/dist/services/processor-discovery/index.js.map +1 -1
- package/dist/services/processor-discovery/processor-discovery.service.d.ts +30 -138
- package/dist/services/processor-discovery/processor-discovery.service.d.ts.map +1 -1
- package/dist/services/processor-discovery/processor-discovery.service.js +125 -502
- package/dist/services/processor-discovery/processor-discovery.service.js.map +1 -1
- package/dist/services/processor-discovery/processor-registry.d.ts +58 -0
- package/dist/services/processor-discovery/processor-registry.d.ts.map +1 -0
- package/dist/services/processor-discovery/processor-registry.js +74 -0
- package/dist/services/processor-discovery/processor-registry.js.map +1 -0
- package/dist/services/processor-discovery/scaling-registration.service.d.ts +60 -0
- package/dist/services/processor-discovery/scaling-registration.service.d.ts.map +1 -0
- package/dist/services/processor-discovery/scaling-registration.service.js +261 -0
- package/dist/services/processor-discovery/scaling-registration.service.js.map +1 -0
- package/dist/services/processor-discovery/worker-factory.service.d.ts +54 -0
- package/dist/services/processor-discovery/worker-factory.service.d.ts.map +1 -0
- package/dist/services/processor-discovery/worker-factory.service.js +185 -0
- package/dist/services/processor-discovery/worker-factory.service.js.map +1 -0
- package/dist/services/queue-bus/entity-target.d.ts +58 -0
- package/dist/services/queue-bus/entity-target.d.ts.map +1 -0
- package/dist/services/queue-bus/entity-target.js +109 -0
- package/dist/services/queue-bus/entity-target.js.map +1 -0
- package/dist/services/queue-bus/index.d.ts +4 -0
- package/dist/services/queue-bus/index.d.ts.map +1 -1
- package/dist/services/queue-bus/index.js +4 -0
- package/dist/services/queue-bus/index.js.map +1 -1
- package/dist/services/queue-bus/queue-bus.service.d.ts +9 -145
- package/dist/services/queue-bus/queue-bus.service.d.ts.map +1 -1
- package/dist/services/queue-bus/queue-bus.service.js +23 -311
- package/dist/services/queue-bus/queue-bus.service.js.map +1 -1
- package/dist/services/queue-bus/queue-bus.types.d.ts +40 -0
- package/dist/services/queue-bus/queue-bus.types.d.ts.map +1 -0
- package/dist/services/queue-bus/queue-bus.types.js +3 -0
- package/dist/services/queue-bus/queue-bus.types.js.map +1 -0
- package/dist/services/queue-bus/queue-bus.utils.d.ts +34 -0
- package/dist/services/queue-bus/queue-bus.utils.d.ts.map +1 -0
- package/dist/services/queue-bus/queue-bus.utils.js +82 -0
- package/dist/services/queue-bus/queue-bus.utils.js.map +1 -0
- package/dist/services/queue-bus/queue-target.d.ts +61 -0
- package/dist/services/queue-bus/queue-target.d.ts.map +1 -0
- package/dist/services/queue-bus/queue-target.js +123 -0
- package/dist/services/queue-bus/queue-target.js.map +1 -0
- package/dist/services/queue-events-manager/queue-events-manager.service.d.ts +23 -6
- package/dist/services/queue-events-manager/queue-events-manager.service.d.ts.map +1 -1
- package/dist/services/queue-events-manager/queue-events-manager.service.js +69 -37
- package/dist/services/queue-events-manager/queue-events-manager.service.js.map +1 -1
- package/dist/services/resource-lock/resource-lock.service.d.ts +0 -4
- package/dist/services/resource-lock/resource-lock.service.d.ts.map +1 -1
- package/dist/services/resource-lock/resource-lock.service.js +4 -16
- package/dist/services/resource-lock/resource-lock.service.js.map +1 -1
- package/dist/services/service-queue/index.d.ts +1 -0
- package/dist/services/service-queue/index.d.ts.map +1 -1
- package/dist/services/service-queue/index.js +1 -0
- package/dist/services/service-queue/index.js.map +1 -1
- package/dist/services/service-queue/service-queue.service.d.ts +2 -35
- package/dist/services/service-queue/service-queue.service.d.ts.map +1 -1
- package/dist/services/service-queue/service-queue.service.js +17 -49
- package/dist/services/service-queue/service-queue.service.js.map +1 -1
- package/dist/services/service-queue/service-queue.types.d.ts +32 -0
- package/dist/services/service-queue/service-queue.types.d.ts.map +1 -0
- package/dist/services/service-queue/service-queue.types.js +27 -0
- package/dist/services/service-queue/service-queue.types.js.map +1 -0
- package/dist/services/spawn-queue/index.d.ts +2 -0
- package/dist/services/spawn-queue/index.d.ts.map +1 -0
- package/dist/services/spawn-queue/index.js +18 -0
- package/dist/services/spawn-queue/index.js.map +1 -0
- package/dist/services/spawn-queue/spawn-queue.service.d.ts +119 -0
- package/dist/services/spawn-queue/spawn-queue.service.d.ts.map +1 -0
- package/dist/services/spawn-queue/spawn-queue.service.js +273 -0
- package/dist/services/spawn-queue/spawn-queue.service.js.map +1 -0
- package/dist/services/worker-manager/worker-manager.service.d.ts +18 -3
- package/dist/services/worker-manager/worker-manager.service.d.ts.map +1 -1
- package/dist/services/worker-manager/worker-manager.service.js +46 -21
- package/dist/services/worker-manager/worker-manager.service.js.map +1 -1
- package/dist/utils/async.utils.d.ts +51 -0
- package/dist/utils/async.utils.d.ts.map +1 -0
- package/dist/utils/async.utils.js +87 -0
- package/dist/utils/async.utils.js.map +1 -0
- package/dist/utils/helpers.d.ts +4 -123
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +18 -226
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/job.utils.d.ts +50 -0
- package/dist/utils/job.utils.d.ts.map +1 -0
- package/dist/utils/job.utils.js +89 -0
- package/dist/utils/job.utils.js.map +1 -0
- package/dist/utils/naming.utils.d.ts +21 -0
- package/dist/utils/naming.utils.d.ts.map +1 -0
- package/dist/utils/naming.utils.js +38 -0
- package/dist/utils/naming.utils.js.map +1 -0
- package/dist/utils/rate-limit.utils.d.ts +9 -0
- package/dist/utils/rate-limit.utils.d.ts.map +1 -0
- package/dist/utils/rate-limit.utils.js +30 -0
- package/dist/utils/rate-limit.utils.js.map +1 -0
- package/dist/utils/redis.utils.d.ts +3 -0
- package/dist/utils/redis.utils.d.ts.map +1 -0
- package/dist/utils/redis.utils.js +14 -0
- package/dist/utils/redis.utils.js.map +1 -0
- package/package.json +17 -17
- package/dist/decorators/decorators.d.ts +0 -489
- package/dist/decorators/decorators.d.ts.map +0 -1
- package/dist/decorators/decorators.js +0 -680
- package/dist/decorators/decorators.js.map +0 -1
- package/dist/domain/interfaces.d.ts +0 -748
- package/dist/domain/interfaces.d.ts.map +0 -1
- package/dist/domain/interfaces.js +0 -19
- package/dist/domain/interfaces.js.map +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var WorkerFactoryService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.WorkerFactoryService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const worker_manager_1 = require("../worker-manager");
|
|
19
|
+
const queue_manager_1 = require("../queue-manager");
|
|
20
|
+
const command_discovery_1 = require("../command-discovery");
|
|
21
|
+
const queue_bus_1 = require("../queue-bus");
|
|
22
|
+
const constants_1 = require("../constants");
|
|
23
|
+
/**
|
|
24
|
+
* WorkerFactoryService
|
|
25
|
+
*
|
|
26
|
+
* Responsible for creating workers for entities and processing jobs
|
|
27
|
+
* through the registered handler pipeline.
|
|
28
|
+
*/
|
|
29
|
+
let WorkerFactoryService = WorkerFactoryService_1 = class WorkerFactoryService {
|
|
30
|
+
constructor(workerManager, queueManager, commandDiscovery, config) {
|
|
31
|
+
this.workerManager = workerManager;
|
|
32
|
+
this.queueManager = queueManager;
|
|
33
|
+
this.commandDiscovery = commandDiscovery;
|
|
34
|
+
this.config = config;
|
|
35
|
+
this.logger = new common_1.Logger(WorkerFactoryService_1.name);
|
|
36
|
+
this.commandBus = null;
|
|
37
|
+
this.queryBus = null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Set the ProcessorRegistry reference (called by orchestrator after construction)
|
|
41
|
+
*/
|
|
42
|
+
setRegistry(registry) {
|
|
43
|
+
this.registry = registry;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Set the CommandBus for executing commands from QueueBus registry
|
|
47
|
+
*/
|
|
48
|
+
setCommandBus(bus) {
|
|
49
|
+
this.commandBus = bus;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set the QueryBus for executing queries from QueueBus registry
|
|
53
|
+
*/
|
|
54
|
+
setQueryBus(bus) {
|
|
55
|
+
this.queryBus = bus;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a worker for an entity using the registered processor
|
|
59
|
+
*/
|
|
60
|
+
async createWorkerForEntity(entityType, entityId) {
|
|
61
|
+
const processor = this.registry.getProcessor(entityType);
|
|
62
|
+
if (!processor) {
|
|
63
|
+
throw new Error(`No processor registered for entity type: ${entityType}`);
|
|
64
|
+
}
|
|
65
|
+
const workerName = processor.workerNameFn(entityId);
|
|
66
|
+
const queueName = processor.queueNameFn(entityId);
|
|
67
|
+
// Check if worker already exists
|
|
68
|
+
if (await this.workerManager.workerExists(workerName)) {
|
|
69
|
+
this.logger.debug(`Worker ${workerName} already exists, skipping`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.logger.log(`Creating worker ${workerName} for ${entityType}:${entityId}`);
|
|
73
|
+
// Ensure queue exists
|
|
74
|
+
this.queueManager.getOrCreateQueue(queueName);
|
|
75
|
+
// Create the worker with the processor
|
|
76
|
+
const workerConfig = {
|
|
77
|
+
concurrency: 1,
|
|
78
|
+
stalledInterval: 1000,
|
|
79
|
+
lockDuration: 30000,
|
|
80
|
+
heartbeatTTL: 3,
|
|
81
|
+
heartbeatInterval: 1000,
|
|
82
|
+
...this.config.workerDefaults,
|
|
83
|
+
...processor.options.workerConfig,
|
|
84
|
+
};
|
|
85
|
+
await this.workerManager.createWorker({
|
|
86
|
+
workerName,
|
|
87
|
+
queueName,
|
|
88
|
+
config: workerConfig,
|
|
89
|
+
processor: async (job) => {
|
|
90
|
+
return this.processJob(processor, job, entityId);
|
|
91
|
+
},
|
|
92
|
+
events: {
|
|
93
|
+
onReady: async () => {
|
|
94
|
+
this.logger.log(`Worker ${workerName} ready`);
|
|
95
|
+
this.registry.addActiveWorker(entityType, entityId);
|
|
96
|
+
},
|
|
97
|
+
onCompleted: async (job) => {
|
|
98
|
+
this.logger.debug(`Worker ${workerName}: Job ${job.id} completed`);
|
|
99
|
+
},
|
|
100
|
+
onFailed: async (job, error) => {
|
|
101
|
+
this.logger.error(`Worker ${workerName}: Job ${job?.id} failed: ${error.message}`);
|
|
102
|
+
},
|
|
103
|
+
onClosed: async () => {
|
|
104
|
+
this.logger.log(`Worker ${workerName} closed`);
|
|
105
|
+
this.registry.removeActiveWorker(entityType, entityId);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Process a job using the registered handlers
|
|
112
|
+
*
|
|
113
|
+
* Priority order:
|
|
114
|
+
* 1. Explicit @JobHandler on the processor class (if instance exists)
|
|
115
|
+
* 2. Auto-routing via @JobCommand/@JobQuery decorated classes
|
|
116
|
+
* 3. QueueBus registry lookup (class name as job name)
|
|
117
|
+
* 4. Wildcard @JobHandler('*') on the processor class (if instance exists)
|
|
118
|
+
*/
|
|
119
|
+
async processJob(processor, job, entityId) {
|
|
120
|
+
const { processorInstance, jobHandlers, wildcardHandler, entityType } = processor;
|
|
121
|
+
const jobName = job.name;
|
|
122
|
+
// 1. Try to find specific @JobHandler (only if processor has an instance)
|
|
123
|
+
if (processorInstance) {
|
|
124
|
+
const handler = jobHandlers.get(jobName);
|
|
125
|
+
if (handler) {
|
|
126
|
+
return processorInstance[handler.method](job, entityId);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// 2. Try auto-routing via @JobCommand/@JobQuery
|
|
130
|
+
if (this.commandDiscovery) {
|
|
131
|
+
const result = await this.commandDiscovery.executeJob(job, entityId, entityType);
|
|
132
|
+
if (result !== undefined) {
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
// Check if a handler exists (even if it returned undefined)
|
|
136
|
+
if (this.commandDiscovery.hasHandler(jobName, entityType)) {
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// 3. Try QueueBus registry lookup (job.name = class name like 'MakeBetCommand')
|
|
141
|
+
const registryEntry = queue_bus_1.QueueBus.getRegistered(jobName);
|
|
142
|
+
if (registryEntry) {
|
|
143
|
+
return this.executeFromRegistry(registryEntry, job, entityId);
|
|
144
|
+
}
|
|
145
|
+
// 4. Fall back to wildcard handler (only if processor has an instance)
|
|
146
|
+
if (processorInstance && wildcardHandler) {
|
|
147
|
+
return processorInstance[wildcardHandler.method](job, entityId);
|
|
148
|
+
}
|
|
149
|
+
// No handler found
|
|
150
|
+
this.logger.warn(`No handler found for job '${jobName}' on entity type '${entityType}'`);
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Execute a command/query from QueueBus registry
|
|
155
|
+
*/
|
|
156
|
+
async executeFromRegistry(entry, job, entityId) {
|
|
157
|
+
const { targetClass, isQuery, className } = entry;
|
|
158
|
+
// Instantiate the command/query with job data
|
|
159
|
+
const instance = Object.assign(new targetClass(), job.data);
|
|
160
|
+
if (isQuery) {
|
|
161
|
+
if (!this.queryBus) {
|
|
162
|
+
this.logger.error(`QueryBus not set. Cannot execute query ${className}. Call setQueryBus() first.`);
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
return this.queryBus.execute(instance);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
if (!this.commandBus) {
|
|
169
|
+
this.logger.error(`CommandBus not set. Cannot execute command ${className}. Call setCommandBus() first.`);
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return this.commandBus.execute(instance);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
exports.WorkerFactoryService = WorkerFactoryService;
|
|
177
|
+
exports.WorkerFactoryService = WorkerFactoryService = WorkerFactoryService_1 = __decorate([
|
|
178
|
+
(0, common_1.Injectable)(),
|
|
179
|
+
__param(2, (0, common_1.Optional)()),
|
|
180
|
+
__param(3, (0, common_1.Inject)(constants_1.ATOMIC_QUEUES_CONFIG)),
|
|
181
|
+
__metadata("design:paramtypes", [worker_manager_1.WorkerManagerService,
|
|
182
|
+
queue_manager_1.QueueManagerService,
|
|
183
|
+
command_discovery_1.CommandDiscoveryService, Object])
|
|
184
|
+
], WorkerFactoryService);
|
|
185
|
+
//# sourceMappingURL=worker-factory.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-factory.service.js","sourceRoot":"","sources":["../../../src/services/processor-discovery/worker-factory.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAMwB;AAGxB,sDAAyD;AACzD,oDA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C,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF,CAAA;AA5LY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAWR,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,gCAAoB,CAAC,CAAA;qCAHG,qCAAoB;QACrB,mCAAmB;QACH,2CAAuB;GAV7D,oBAAoB,CA4LhC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Job } from 'bullmq';
|
|
2
|
+
import { QueueManagerService } from '../queue-manager/queue-manager.service';
|
|
3
|
+
import { QueueEventsManagerService } from '../queue-events-manager/queue-events-manager.service';
|
|
4
|
+
import { IEntityConfig } from '../../domain/interfaces';
|
|
5
|
+
import { EnqueueOptions } from './queue-bus.types';
|
|
6
|
+
/**
|
|
7
|
+
* EntityTarget - Fluent builder for targeting a specific entity type's queue
|
|
8
|
+
* without needing a @WorkerProcessor class.
|
|
9
|
+
*
|
|
10
|
+
* This is the zero-boilerplate way to enqueue commands when you've configured
|
|
11
|
+
* entity defaults in the module config.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* await queueBus
|
|
15
|
+
* .forEntity('table')
|
|
16
|
+
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
17
|
+
*/
|
|
18
|
+
export declare class EntityTarget {
|
|
19
|
+
private readonly queueManager;
|
|
20
|
+
private readonly entityType;
|
|
21
|
+
private readonly entityConfig;
|
|
22
|
+
private readonly keyPrefix;
|
|
23
|
+
private readonly queueEventsManager?;
|
|
24
|
+
private readonly logger;
|
|
25
|
+
constructor(queueManager: QueueManagerService, entityType: string, entityConfig: IEntityConfig | undefined, keyPrefix: string, queueEventsManager?: QueueEventsManagerService | undefined);
|
|
26
|
+
/**
|
|
27
|
+
* Get the queue name function from entity config or defaults
|
|
28
|
+
*/
|
|
29
|
+
private getQueueNameFn;
|
|
30
|
+
/**
|
|
31
|
+
* Extract entity ID using the priority chain (no processor-level default)
|
|
32
|
+
*/
|
|
33
|
+
private extractEntityId;
|
|
34
|
+
/**
|
|
35
|
+
* Enqueue a command/query for processing
|
|
36
|
+
*
|
|
37
|
+
* @param commandOrQuery - The command or query instance
|
|
38
|
+
* @param options - Optional settings (entityId override, jobOptions)
|
|
39
|
+
* @returns The created BullMQ job
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await queueBus
|
|
43
|
+
* .forEntity('table')
|
|
44
|
+
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
45
|
+
*/
|
|
46
|
+
enqueue<T extends object>(commandOrQuery: T, options?: EnqueueOptions): Promise<Job>;
|
|
47
|
+
/**
|
|
48
|
+
* Enqueue and wait for result
|
|
49
|
+
*/
|
|
50
|
+
enqueueAndWait<T extends object, R = any>(commandOrQuery: T, options?: EnqueueOptions & {
|
|
51
|
+
timeout?: number;
|
|
52
|
+
}): Promise<R>;
|
|
53
|
+
/**
|
|
54
|
+
* Enqueue multiple commands/queries in bulk
|
|
55
|
+
*/
|
|
56
|
+
enqueueBulk<T extends object>(commandsOrQueries: T[], options?: EnqueueOptions): Promise<Job[]>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=entity-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-target.d.ts","sourceRoot":"","sources":["../../../src/services/queue-bus/entity-target.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IAIrB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAPtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;gBAGrC,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,aAAa,GAAG,SAAS,EACvC,SAAS,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,yBAAyB,YAAA;IAGjE;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;;;;;;;;;;OAWG;IACG,OAAO,CAAC,CAAC,SAAS,MAAM,EAC5B,cAAc,EAAE,CAAC,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,GAAG,CAAC;IAsBf;;OAEG;IACG,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,GAAG,EAC5C,cAAc,EAAE,CAAC,EACjB,OAAO,CAAC,EAAE,cAAc,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC9C,OAAO,CAAC,CAAC,CAAC;IAab;;OAEG;IACG,WAAW,CAAC,CAAC,SAAS,MAAM,EAChC,iBAAiB,EAAE,CAAC,EAAE,EACtB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,GAAG,EAAE,CAAC;CA4BlB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityTarget = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const queue_bus_utils_1 = require("./queue-bus.utils");
|
|
6
|
+
/**
|
|
7
|
+
* EntityTarget - Fluent builder for targeting a specific entity type's queue
|
|
8
|
+
* without needing a @WorkerProcessor class.
|
|
9
|
+
*
|
|
10
|
+
* This is the zero-boilerplate way to enqueue commands when you've configured
|
|
11
|
+
* entity defaults in the module config.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* await queueBus
|
|
15
|
+
* .forEntity('table')
|
|
16
|
+
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
17
|
+
*/
|
|
18
|
+
class EntityTarget {
|
|
19
|
+
constructor(queueManager, entityType, entityConfig, keyPrefix, queueEventsManager) {
|
|
20
|
+
this.queueManager = queueManager;
|
|
21
|
+
this.entityType = entityType;
|
|
22
|
+
this.entityConfig = entityConfig;
|
|
23
|
+
this.keyPrefix = keyPrefix;
|
|
24
|
+
this.queueEventsManager = queueEventsManager;
|
|
25
|
+
this.logger = new common_1.Logger(EntityTarget.name);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the queue name function from entity config or defaults
|
|
29
|
+
*/
|
|
30
|
+
getQueueNameFn() {
|
|
31
|
+
if (this.entityConfig?.queueName) {
|
|
32
|
+
return this.entityConfig.queueName;
|
|
33
|
+
}
|
|
34
|
+
// Default: {keyPrefix}-{entityType}-{entityId}-queue
|
|
35
|
+
return (entityId) => `${this.keyPrefix}-${this.entityType}-${entityId}-queue`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Extract entity ID using the priority chain (no processor-level default)
|
|
39
|
+
*/
|
|
40
|
+
extractEntityId(commandOrQuery, data) {
|
|
41
|
+
return (0, queue_bus_utils_1.extractEntityIdExplicit)(commandOrQuery, data, undefined, // No processor default for forEntity()
|
|
42
|
+
this.entityConfig, this.logger);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Enqueue a command/query for processing
|
|
46
|
+
*
|
|
47
|
+
* @param commandOrQuery - The command or query instance
|
|
48
|
+
* @param options - Optional settings (entityId override, jobOptions)
|
|
49
|
+
* @returns The created BullMQ job
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await queueBus
|
|
53
|
+
* .forEntity('table')
|
|
54
|
+
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
55
|
+
*/
|
|
56
|
+
async enqueue(commandOrQuery, options) {
|
|
57
|
+
const jobName = (0, queue_bus_utils_1.getJobName)(commandOrQuery);
|
|
58
|
+
const data = (0, queue_bus_utils_1.extractData)(commandOrQuery);
|
|
59
|
+
const entityId = options?.entityId ?? this.extractEntityId(commandOrQuery, data);
|
|
60
|
+
const queueNameFn = this.getQueueNameFn();
|
|
61
|
+
const queueName = queueNameFn(entityId);
|
|
62
|
+
this.logger.debug(`[forEntity:${this.entityType}] Adding job ${jobName} to queue ${queueName}`);
|
|
63
|
+
// Get queue and ensure event listening
|
|
64
|
+
const queue = this.queueManager.getOrCreateQueue(queueName);
|
|
65
|
+
if (this.queueEventsManager) {
|
|
66
|
+
await this.queueEventsManager.ensureListening(queueName, this.entityType);
|
|
67
|
+
}
|
|
68
|
+
// Add job to queue
|
|
69
|
+
return queue.add(jobName, data, options?.jobOptions);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Enqueue and wait for result
|
|
73
|
+
*/
|
|
74
|
+
async enqueueAndWait(commandOrQuery, options) {
|
|
75
|
+
const job = await this.enqueue(commandOrQuery, options);
|
|
76
|
+
const data = (0, queue_bus_utils_1.extractData)(commandOrQuery);
|
|
77
|
+
const entityId = options?.entityId ?? this.extractEntityId(commandOrQuery, data);
|
|
78
|
+
const queueNameFn = this.getQueueNameFn();
|
|
79
|
+
const queueName = queueNameFn(entityId);
|
|
80
|
+
const queueEvents = await this.queueManager.getQueueEvents(queueName);
|
|
81
|
+
return job.waitUntilFinished(queueEvents, options?.timeout);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Enqueue multiple commands/queries in bulk
|
|
85
|
+
*/
|
|
86
|
+
async enqueueBulk(commandsOrQueries, options) {
|
|
87
|
+
if (commandsOrQueries.length === 0)
|
|
88
|
+
return [];
|
|
89
|
+
const firstCmd = commandsOrQueries[0];
|
|
90
|
+
const firstData = (0, queue_bus_utils_1.extractData)(firstCmd);
|
|
91
|
+
const entityId = options?.entityId ?? this.extractEntityId(firstCmd, firstData);
|
|
92
|
+
const queueNameFn = this.getQueueNameFn();
|
|
93
|
+
const queueName = queueNameFn(entityId);
|
|
94
|
+
const queue = this.queueManager.getOrCreateQueue(queueName);
|
|
95
|
+
// Ensure listening is set up for auto-spawn
|
|
96
|
+
if (this.queueEventsManager) {
|
|
97
|
+
await this.queueEventsManager.ensureListening(queueName, this.entityType);
|
|
98
|
+
}
|
|
99
|
+
const bulkJobs = commandsOrQueries.map((cmd) => ({
|
|
100
|
+
name: (0, queue_bus_utils_1.getJobName)(cmd),
|
|
101
|
+
data: (0, queue_bus_utils_1.extractData)(cmd),
|
|
102
|
+
opts: options?.jobOptions,
|
|
103
|
+
}));
|
|
104
|
+
this.logger.debug(`[forEntity:${this.entityType}] Adding ${bulkJobs.length} jobs to queue ${queueName}`);
|
|
105
|
+
return queue.addBulk(bulkJobs);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.EntityTarget = EntityTarget;
|
|
109
|
+
//# sourceMappingURL=entity-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-target.js","sourceRoot":"","sources":["../../../src/services/queue-bus/entity-target.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAMxC,uDAAqF;AAErF;;;;;;;;;;;GAWG;AACH,MAAa,YAAY;IAGvB,YACmB,YAAiC,EACjC,UAAkB,EAClB,YAAuC,EACvC,SAAiB,EACjB,kBAA8C;QAJ9C,iBAAY,GAAZ,YAAY,CAAqB;QACjC,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAA2B;QACvC,cAAS,GAAT,SAAS,CAAQ;QACjB,uBAAkB,GAAlB,kBAAkB,CAA4B;QAPhD,WAAM,GAAG,IAAI,eAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAQrD,CAAC;IAEJ;;OAEG;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AAY,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAE5D,4CAA4C;QAC5C,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5E,CAAC;QAED,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC/C,IAAI,EAAE,IAAA,4BAAU,EAAC,GAAG,CAAC;YACrB,IAAI,EAAE,IAAA,6BAAW,EAAC,GAAG,CAAC;YACtB,IAAI,EAAE,OAAO,EAAE,UAAU;SAC1B,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,cAAc,IAAI,CAAC,UAAU,YAAY,QAAQ,CAAC,MAAM,kBAAkB,SAAS,EAAE,CACtF,CAAC;QAEF,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;CACF;AA/HD,oCA+HC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/queue-bus/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/queue-bus/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
@@ -14,5 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./queue-bus.types"), exports);
|
|
18
|
+
__exportStar(require("./queue-bus.utils"), exports);
|
|
19
|
+
__exportStar(require("./queue-target"), exports);
|
|
20
|
+
__exportStar(require("./entity-target"), exports);
|
|
17
21
|
__exportStar(require("./queue-bus.service"), exports);
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/queue-bus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/queue-bus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,iDAA+B;AAC/B,kDAAgC;AAChC,sDAAoC"}
|
|
@@ -1,148 +1,11 @@
|
|
|
1
1
|
import { Type } from '@nestjs/common';
|
|
2
|
-
import { Job
|
|
2
|
+
import { Job } from 'bullmq';
|
|
3
3
|
import { QueueManagerService } from '../queue-manager/queue-manager.service';
|
|
4
|
-
import {
|
|
5
|
-
import { IAtomicQueuesModuleConfig
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export interface QueueBusExecuteOptions {
|
|
11
|
-
/**
|
|
12
|
-
* The entity ID to use for queue name resolution.
|
|
13
|
-
* If not provided, will try to extract from command properties:
|
|
14
|
-
* entityId, tableId, userId, id (in that order)
|
|
15
|
-
*/
|
|
16
|
-
entityId?: string;
|
|
17
|
-
/**
|
|
18
|
-
* BullMQ job options (priority, delay, attempts, etc.)
|
|
19
|
-
*/
|
|
20
|
-
jobOptions?: JobsOptions;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Options for .enqueue()
|
|
24
|
-
*/
|
|
25
|
-
export interface EnqueueOptions {
|
|
26
|
-
/**
|
|
27
|
-
* Override the auto-extracted entityId
|
|
28
|
-
*/
|
|
29
|
-
entityId?: string;
|
|
30
|
-
/**
|
|
31
|
-
* BullMQ job options (priority, delay, attempts, etc.)
|
|
32
|
-
*/
|
|
33
|
-
jobOptions?: JobsOptions;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Registry entry for a command/query class
|
|
37
|
-
*/
|
|
38
|
-
export interface CommandRegistryEntry {
|
|
39
|
-
className: string;
|
|
40
|
-
targetClass: Type<any>;
|
|
41
|
-
isQuery: boolean;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* QueueTarget - Fluent builder for targeting a specific processor's queue
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* await queueBus
|
|
48
|
-
* .forProcessor(TableWorkerProcessor)
|
|
49
|
-
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
50
|
-
*/
|
|
51
|
-
export declare class QueueTarget {
|
|
52
|
-
private readonly queueManager;
|
|
53
|
-
private readonly processorClass;
|
|
54
|
-
private readonly processorOptions;
|
|
55
|
-
private readonly entityConfig?;
|
|
56
|
-
private readonly logger;
|
|
57
|
-
constructor(queueManager: QueueManagerService, processorClass: Type<any>, processorOptions: WorkerProcessorOptions, entityConfig?: IEntityConfig | undefined);
|
|
58
|
-
/**
|
|
59
|
-
* Get the queue name function from the processor
|
|
60
|
-
*/
|
|
61
|
-
private getQueueNameFn;
|
|
62
|
-
/**
|
|
63
|
-
* Extract entity ID using the priority chain
|
|
64
|
-
*/
|
|
65
|
-
private extractEntityId;
|
|
66
|
-
/**
|
|
67
|
-
* Enqueue a command/query for processing
|
|
68
|
-
*
|
|
69
|
-
* @param commandOrQuery - The command or query instance
|
|
70
|
-
* @param options - Optional settings (entityId override, jobOptions)
|
|
71
|
-
* @returns The created BullMQ job
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* await queueBus
|
|
75
|
-
* .forProcessor(TableWorkerProcessor)
|
|
76
|
-
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
77
|
-
*
|
|
78
|
-
* // With job options
|
|
79
|
-
* await queueBus
|
|
80
|
-
* .forProcessor(TableWorkerProcessor)
|
|
81
|
-
* .enqueue(new DealCommand(tableId), { jobOptions: { delay: 5000 } });
|
|
82
|
-
*/
|
|
83
|
-
enqueue<T extends object>(commandOrQuery: T, options?: EnqueueOptions): Promise<Job>;
|
|
84
|
-
/**
|
|
85
|
-
* Enqueue and wait for result
|
|
86
|
-
*/
|
|
87
|
-
enqueueAndWait<T extends object, R = any>(commandOrQuery: T, options?: EnqueueOptions & {
|
|
88
|
-
timeout?: number;
|
|
89
|
-
}): Promise<R>;
|
|
90
|
-
/**
|
|
91
|
-
* Enqueue multiple commands/queries in bulk
|
|
92
|
-
*/
|
|
93
|
-
enqueueBulk<T extends object>(commandsOrQueries: T[], options?: EnqueueOptions): Promise<Job[]>;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* EntityTarget - Fluent builder for targeting a specific entity type's queue
|
|
97
|
-
* without needing a @WorkerProcessor class.
|
|
98
|
-
*
|
|
99
|
-
* This is the zero-boilerplate way to enqueue commands when you've configured
|
|
100
|
-
* entity defaults in the module config.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* await queueBus
|
|
104
|
-
* .forEntity('table')
|
|
105
|
-
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
106
|
-
*/
|
|
107
|
-
export declare class EntityTarget {
|
|
108
|
-
private readonly queueManager;
|
|
109
|
-
private readonly entityType;
|
|
110
|
-
private readonly entityConfig;
|
|
111
|
-
private readonly keyPrefix;
|
|
112
|
-
private readonly logger;
|
|
113
|
-
constructor(queueManager: QueueManagerService, entityType: string, entityConfig: IEntityConfig | undefined, keyPrefix: string);
|
|
114
|
-
/**
|
|
115
|
-
* Get the queue name function from entity config or defaults
|
|
116
|
-
*/
|
|
117
|
-
private getQueueNameFn;
|
|
118
|
-
/**
|
|
119
|
-
* Extract entity ID using the priority chain (no processor-level default)
|
|
120
|
-
*/
|
|
121
|
-
private extractEntityId;
|
|
122
|
-
/**
|
|
123
|
-
* Enqueue a command/query for processing
|
|
124
|
-
*
|
|
125
|
-
* @param commandOrQuery - The command or query instance
|
|
126
|
-
* @param options - Optional settings (entityId override, jobOptions)
|
|
127
|
-
* @returns The created BullMQ job
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* await queueBus
|
|
131
|
-
* .forEntity('table')
|
|
132
|
-
* .enqueue(new MakeBetCommand(tableId, bets, player));
|
|
133
|
-
*/
|
|
134
|
-
enqueue<T extends object>(commandOrQuery: T, options?: EnqueueOptions): Promise<Job>;
|
|
135
|
-
/**
|
|
136
|
-
* Enqueue and wait for result
|
|
137
|
-
*/
|
|
138
|
-
enqueueAndWait<T extends object, R = any>(commandOrQuery: T, options?: EnqueueOptions & {
|
|
139
|
-
timeout?: number;
|
|
140
|
-
}): Promise<R>;
|
|
141
|
-
/**
|
|
142
|
-
* Enqueue multiple commands/queries in bulk
|
|
143
|
-
*/
|
|
144
|
-
enqueueBulk<T extends object>(commandsOrQueries: T[], options?: EnqueueOptions): Promise<Job[]>;
|
|
145
|
-
}
|
|
4
|
+
import { QueueEventsManagerService } from '../queue-events-manager/queue-events-manager.service';
|
|
5
|
+
import { IAtomicQueuesModuleConfig } from '../../domain/interfaces';
|
|
6
|
+
import { QueueBusExecuteOptions, EnqueueOptions, CommandRegistryEntry } from './queue-bus.types';
|
|
7
|
+
import { QueueTarget } from './queue-target';
|
|
8
|
+
import { EntityTarget } from './entity-target';
|
|
146
9
|
/**
|
|
147
10
|
* QueueBus
|
|
148
11
|
*
|
|
@@ -180,6 +43,7 @@ export declare class EntityTarget {
|
|
|
180
43
|
*/
|
|
181
44
|
export declare class QueueBus {
|
|
182
45
|
private readonly queueManager;
|
|
46
|
+
private readonly queueEventsManager?;
|
|
183
47
|
private readonly logger;
|
|
184
48
|
/**
|
|
185
49
|
* Cache of processor options by class
|
|
@@ -195,9 +59,9 @@ export declare class QueueBus {
|
|
|
195
59
|
* Module config for entity defaults
|
|
196
60
|
*/
|
|
197
61
|
private readonly config;
|
|
198
|
-
constructor(queueManager: QueueManagerService, config?: IAtomicQueuesModuleConfig);
|
|
62
|
+
constructor(queueManager: QueueManagerService, queueEventsManager?: QueueEventsManagerService | undefined, config?: IAtomicQueuesModuleConfig);
|
|
199
63
|
/**
|
|
200
|
-
* Get key prefix from config
|
|
64
|
+
* Get key prefix from config using resolveKeyPrefix utility
|
|
201
65
|
*/
|
|
202
66
|
private get keyPrefix();
|
|
203
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-bus.service.d.ts","sourceRoot":"","sources":["../../../src/services/queue-bus/queue-bus.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"queue-bus.service.d.ts","sourceRoot":"","sources":["../../../src/services/queue-bus/queue-bus.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AAMjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGpE,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEjG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBACa,QAAQ;IAqBjB,OAAO,CAAC,QAAQ,CAAC,YAAY;IACjB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IArBlD,OAAO,C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