@lavoro/memory 0.3.1 → 0.4.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/build/index.d.ts +21 -1
- package/build/index.js +211 -2
- package/build/index.js.map +1 -1
- package/package.json +4 -1
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
import { QueueDriver, QueueConfig, WorkerOptions, QueueDriverConfig, ConfiguredDriver } from '@lavoro/core';
|
|
1
|
+
import { QueueDriver, QueueConfig, WorkerOptions, QueueDriverConfig, QueueName, QueueDriverStopOptions, Job, Payload, ConfiguredDriver } from '@lavoro/core';
|
|
2
2
|
import { LockFactory } from '@verrou/core';
|
|
3
|
+
import * as fastq from 'fastq';
|
|
3
4
|
|
|
5
|
+
type MemoryQueueDriverState = {
|
|
6
|
+
isPausing: boolean;
|
|
7
|
+
isStarted: boolean;
|
|
8
|
+
runningJobCount: number;
|
|
9
|
+
};
|
|
4
10
|
declare class MemoryQueueDriver extends QueueDriver {
|
|
11
|
+
protected queues: Map<string, fastq.queueAsPromised<any, any>>;
|
|
12
|
+
protected state: MemoryQueueDriverState;
|
|
5
13
|
constructor(queueConfig: QueueConfig, options: Record<string, WorkerOptions>, config?: QueueDriverConfig);
|
|
6
14
|
createLockProvider(): LockFactory;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param fullyQualifiedJobName
|
|
18
|
+
*/
|
|
19
|
+
private createWorker;
|
|
20
|
+
private runJob;
|
|
21
|
+
private processJob;
|
|
22
|
+
listen(queue: QueueName, options?: WorkerOptions): Promise<void>;
|
|
23
|
+
start(): Promise<void>;
|
|
24
|
+
private waitForQueues;
|
|
25
|
+
stop(options?: QueueDriverStopOptions): Promise<void>;
|
|
26
|
+
enqueue<T extends Job, P extends Payload<T>>(job: T, payload: P): Promise<void>;
|
|
7
27
|
}
|
|
8
28
|
/**
|
|
9
29
|
* In-memory queue driver with no persistence
|
package/build/index.js
CHANGED
|
@@ -1,15 +1,224 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
+
var __reflectGet = Reflect.get;
|
|
4
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
7
|
+
var __async = (__this, __arguments, generator) => {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
var fulfilled = (value) => {
|
|
10
|
+
try {
|
|
11
|
+
step(generator.next(value));
|
|
12
|
+
} catch (e) {
|
|
13
|
+
reject(e);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var rejected = (value) => {
|
|
17
|
+
try {
|
|
18
|
+
step(generator.throw(value));
|
|
19
|
+
} catch (e) {
|
|
20
|
+
reject(e);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
24
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
1
28
|
// src/index.ts
|
|
2
29
|
import {
|
|
30
|
+
Job,
|
|
3
31
|
QueueDriver
|
|
4
32
|
} from "@lavoro/core";
|
|
5
33
|
import { LockFactory } from "@verrou/core";
|
|
6
34
|
import { memoryStore } from "@verrou/core/drivers/memory";
|
|
7
|
-
|
|
35
|
+
import * as fastq from "fastq";
|
|
36
|
+
var MemoryQueueDriver = class _MemoryQueueDriver extends QueueDriver {
|
|
8
37
|
constructor(queueConfig, options, config = {}) {
|
|
9
38
|
super(queueConfig, options, config);
|
|
39
|
+
__publicField(this, "queues", /* @__PURE__ */ new Map());
|
|
40
|
+
__publicField(this, "state", {
|
|
41
|
+
isPausing: false,
|
|
42
|
+
isStarted: false,
|
|
43
|
+
runningJobCount: 0
|
|
44
|
+
});
|
|
10
45
|
}
|
|
11
46
|
createLockProvider() {
|
|
12
|
-
|
|
47
|
+
this.lockFactory = new LockFactory(memoryStore().factory());
|
|
48
|
+
return this.lockFactory;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param fullyQualifiedJobName
|
|
53
|
+
*/
|
|
54
|
+
createWorker(fullyQualifiedJobName, options) {
|
|
55
|
+
return __async(this, null, function* () {
|
|
56
|
+
var _a;
|
|
57
|
+
const { concurrency = 1 } = options;
|
|
58
|
+
const { queue, name } = Job.parseName(fullyQualifiedJobName);
|
|
59
|
+
if (!((_a = this.config) == null ? void 0 : _a.worker) || concurrency === 0) {
|
|
60
|
+
this.logger.trace(
|
|
61
|
+
{ connection: this.connection, queue, job: name },
|
|
62
|
+
"Queue worker is disabled - skipping"
|
|
63
|
+
);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!this.queues.has(fullyQualifiedJobName)) {
|
|
67
|
+
const q = fastq.promise(
|
|
68
|
+
this,
|
|
69
|
+
this.runJob,
|
|
70
|
+
concurrency
|
|
71
|
+
);
|
|
72
|
+
q.pause();
|
|
73
|
+
this.queues.set(fullyQualifiedJobName, q);
|
|
74
|
+
}
|
|
75
|
+
this.logger.trace(
|
|
76
|
+
{
|
|
77
|
+
connection: this.connection,
|
|
78
|
+
queue,
|
|
79
|
+
job: name,
|
|
80
|
+
options
|
|
81
|
+
},
|
|
82
|
+
"Started worker"
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
runJob(data) {
|
|
87
|
+
return __async(this, null, function* () {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
this.state.runningJobCount++;
|
|
90
|
+
try {
|
|
91
|
+
yield this.processJob(data);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
this.logger.error(
|
|
94
|
+
{
|
|
95
|
+
connection: this.connection,
|
|
96
|
+
job: (_a = data.job) == null ? void 0 : _a.name,
|
|
97
|
+
id: (_b = data.job) == null ? void 0 : _b.id,
|
|
98
|
+
err: error
|
|
99
|
+
},
|
|
100
|
+
"Job execution failed"
|
|
101
|
+
);
|
|
102
|
+
throw error;
|
|
103
|
+
} finally {
|
|
104
|
+
this.state.runningJobCount--;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
processJob(data) {
|
|
109
|
+
return __async(this, null, function* () {
|
|
110
|
+
const { job, payload } = data;
|
|
111
|
+
yield this.process({
|
|
112
|
+
id: job.id,
|
|
113
|
+
fullyQualifiedName: job.fullyQualifiedName,
|
|
114
|
+
payload
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
listen(queue, options) {
|
|
119
|
+
return __async(this, null, function* () {
|
|
120
|
+
const mergedOptions = this.getMergedWorkerOptions(queue, options);
|
|
121
|
+
yield __superGet(_MemoryQueueDriver.prototype, this, "listen").call(this, queue, options);
|
|
122
|
+
for (const job of this.registeredJobs.values()) {
|
|
123
|
+
yield this.createWorker(Job.compileName(queue, job.name), mergedOptions);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
start() {
|
|
128
|
+
return __async(this, null, function* () {
|
|
129
|
+
yield __superGet(_MemoryQueueDriver.prototype, this, "start").call(this);
|
|
130
|
+
this.state.isPausing = false;
|
|
131
|
+
this.state.isStarted = true;
|
|
132
|
+
for (const queue of this.queues.values()) {
|
|
133
|
+
queue.resume();
|
|
134
|
+
}
|
|
135
|
+
this.logger.trace(
|
|
136
|
+
{ connection: this.connection, driver: "memory" },
|
|
137
|
+
"Queue driver started"
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
waitForQueues(queues, timeout) {
|
|
142
|
+
return __async(this, null, function* () {
|
|
143
|
+
this.state.isPausing = true;
|
|
144
|
+
for (const queue of queues) {
|
|
145
|
+
queue.pause();
|
|
146
|
+
}
|
|
147
|
+
const waitForIdleState = () => __async(this, null, function* () {
|
|
148
|
+
while (this.state.runningJobCount > 0) {
|
|
149
|
+
yield new Promise((r) => setTimeout(r, 100));
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
yield Promise.race([
|
|
153
|
+
waitForIdleState(),
|
|
154
|
+
new Promise(
|
|
155
|
+
(_, reject) => setTimeout(
|
|
156
|
+
() => reject(new Error("Graceful shutdown timeout reached")),
|
|
157
|
+
timeout
|
|
158
|
+
)
|
|
159
|
+
)
|
|
160
|
+
]);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
stop(options) {
|
|
164
|
+
return __async(this, null, function* () {
|
|
165
|
+
const { graceful = true, timeout = 3e4 } = options || {};
|
|
166
|
+
this.logger.trace(
|
|
167
|
+
{ connection: this.connection, driver: "memory", graceful, timeout },
|
|
168
|
+
`Waiting for fastq to stop...`
|
|
169
|
+
);
|
|
170
|
+
const queues = Array.from(this.queues.values());
|
|
171
|
+
if (graceful) {
|
|
172
|
+
yield this.waitForQueues(queues, timeout);
|
|
173
|
+
}
|
|
174
|
+
for (const queue of queues) {
|
|
175
|
+
queue.pause();
|
|
176
|
+
queue.kill();
|
|
177
|
+
}
|
|
178
|
+
this.queues.clear();
|
|
179
|
+
this.state = {
|
|
180
|
+
isStarted: false,
|
|
181
|
+
isPausing: false,
|
|
182
|
+
runningJobCount: 0
|
|
183
|
+
};
|
|
184
|
+
this.logger.trace(
|
|
185
|
+
{ connection: this.connection, driver: "memory" },
|
|
186
|
+
"Fastq stopped"
|
|
187
|
+
);
|
|
188
|
+
yield __superGet(_MemoryQueueDriver.prototype, this, "stop").call(this);
|
|
189
|
+
this.logger.trace(
|
|
190
|
+
{ connection: this.connection, driver: "memory" },
|
|
191
|
+
"Queue driver stopped"
|
|
192
|
+
);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
enqueue(job, payload) {
|
|
196
|
+
return __async(this, null, function* () {
|
|
197
|
+
if (!this.state.isStarted) {
|
|
198
|
+
throw new Error("Queue driver is not started");
|
|
199
|
+
}
|
|
200
|
+
if (this.state.isPausing) {
|
|
201
|
+
throw new Error(
|
|
202
|
+
"Queue driver is shutting down and cannot accept new jobs"
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
yield __superGet(_MemoryQueueDriver.prototype, this, "enqueue").call(this, job, payload);
|
|
206
|
+
this.logger.trace(
|
|
207
|
+
{
|
|
208
|
+
connection: this.connection,
|
|
209
|
+
queue: job.options.queue,
|
|
210
|
+
job: job.name
|
|
211
|
+
},
|
|
212
|
+
"Enqueuing job"
|
|
213
|
+
);
|
|
214
|
+
const q = this.queues.get(job.fullyQualifiedName);
|
|
215
|
+
if (!q) {
|
|
216
|
+
throw new Error(`No worker found for job: ${job.fullyQualifiedName}`);
|
|
217
|
+
}
|
|
218
|
+
q.push({ job, payload }).catch((error) => {
|
|
219
|
+
this.emit("job:error", error, job, payload);
|
|
220
|
+
});
|
|
221
|
+
});
|
|
13
222
|
}
|
|
14
223
|
};
|
|
15
224
|
function memory(config) {
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n QueueDriver,\n QueueDriverConfig,\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n ConfiguredDriver,\n Job,\n Payload,\n QueueConfig,\n QueueDriver,\n QueueDriverConfig,\n QueueDriverStopOptions,\n QueueName,\n WorkerOptions,\n} from '@lavoro/core'\nimport { LockFactory } from '@verrou/core'\nimport { memoryStore } from '@verrou/core/drivers/memory'\nimport * as fastq from 'fastq'\nimport type { queueAsPromised } from 'fastq'\n\ntype MemoryQueueDriverState = {\n isPausing: boolean\n isStarted: boolean\n runningJobCount: number\n}\n\nexport class MemoryQueueDriver extends QueueDriver {\n protected queues = new Map<string, queueAsPromised>()\n\n protected state: MemoryQueueDriverState = {\n isPausing: false,\n isStarted: false,\n runningJobCount: 0,\n }\n\n constructor(\n queueConfig: QueueConfig,\n options: Record<string, WorkerOptions>,\n config: QueueDriverConfig = {},\n ) {\n super(queueConfig, options, config)\n }\n\n public createLockProvider() {\n this.lockFactory = new LockFactory(memoryStore().factory())\n return this.lockFactory\n }\n\n /**\n *\n * @param fullyQualifiedJobName\n */\n private async createWorker(\n fullyQualifiedJobName: string,\n options: WorkerOptions,\n ): Promise<void> {\n const { concurrency = 1 } = options\n\n const { queue, name } = Job.parseName(fullyQualifiedJobName)\n\n if (!this.config?.worker || concurrency === 0) {\n this.logger.trace(\n { connection: this.connection, queue, job: name },\n 'Queue worker is disabled - skipping',\n )\n\n return\n }\n\n if (!this.queues.has(fullyQualifiedJobName)) {\n const q: queueAsPromised<any> = fastq.promise(\n this,\n this.runJob,\n concurrency,\n )\n\n q.pause()\n\n this.queues.set(fullyQualifiedJobName, q)\n }\n\n this.logger.trace(\n {\n connection: this.connection,\n queue,\n job: name,\n options,\n },\n 'Started worker',\n )\n }\n\n private async runJob(data: any): Promise<void> {\n this.state.runningJobCount++\n\n try {\n await this.processJob(data)\n } catch (error) {\n this.logger.error(\n {\n connection: this.connection,\n job: data.job?.name,\n id: data.job?.id,\n err: error,\n },\n 'Job execution failed',\n )\n throw error\n } finally {\n this.state.runningJobCount--\n }\n }\n\n private async processJob(data: any): Promise<void> {\n const { job, payload }: { job: Job; payload: any } = data\n\n await this.process({\n id: job.id,\n fullyQualifiedName: job.fullyQualifiedName,\n payload,\n })\n }\n\n public async listen(\n queue: QueueName,\n options?: WorkerOptions,\n ): Promise<void> {\n const mergedOptions = this.getMergedWorkerOptions(queue, options)\n await super.listen(queue, options)\n for (const job of this.registeredJobs.values()) {\n await this.createWorker(Job.compileName(queue, job.name), mergedOptions)\n }\n }\n\n public async start(): Promise<void> {\n await super.start()\n\n this.state.isPausing = false\n this.state.isStarted = true\n\n for (const queue of this.queues.values()) {\n queue.resume()\n }\n\n this.logger.trace(\n { connection: this.connection, driver: 'memory' },\n 'Queue driver started',\n )\n }\n\n private async waitForQueues(\n queues: fastq.queueAsPromised[],\n timeout: number,\n ) {\n /**\n * Mark the queue as pausing so it will not\n * accept any new jobs once signaled to stop.\n */\n this.state.isPausing = true\n\n for (const queue of queues) {\n queue.pause()\n }\n\n const waitForIdleState = async () => {\n while (this.state.runningJobCount > 0) {\n await new Promise((r) => setTimeout(r, 100))\n }\n }\n\n await Promise.race([\n waitForIdleState(),\n new Promise((_, reject) =>\n setTimeout(\n () => reject(new Error('Graceful shutdown timeout reached')),\n timeout,\n ),\n ),\n ])\n }\n\n public async stop(options?: QueueDriverStopOptions): Promise<void> {\n const { graceful = true, timeout = 30000 } = options || {}\n\n this.logger.trace(\n { connection: this.connection, driver: 'memory', graceful, timeout },\n `Waiting for fastq to stop...`,\n )\n\n const queues = Array.from(this.queues.values())\n\n if (graceful) {\n await this.waitForQueues(queues, timeout)\n }\n\n for (const queue of queues) {\n queue.pause()\n queue.kill()\n }\n\n this.queues.clear()\n\n this.state = {\n isStarted: false,\n isPausing: false,\n runningJobCount: 0,\n }\n\n this.logger.trace(\n { connection: this.connection, driver: 'memory' },\n 'Fastq stopped',\n )\n\n await super.stop()\n\n this.logger.trace(\n { connection: this.connection, driver: 'memory' },\n 'Queue driver stopped',\n )\n }\n\n public async enqueue<T extends Job, P extends Payload<T>>(\n job: T,\n payload: P,\n ): Promise<void> {\n if (!this.state.isStarted) {\n throw new Error('Queue driver is not started')\n }\n\n if (this.state.isPausing) {\n throw new Error(\n 'Queue driver is shutting down and cannot accept new jobs',\n )\n }\n\n await super.enqueue(job, payload)\n\n this.logger.trace(\n {\n connection: this.connection,\n queue: job.options.queue,\n job: job.name,\n },\n 'Enqueuing job',\n )\n\n const q = this.queues.get(job.fullyQualifiedName)\n\n if (!q) {\n throw new Error(`No worker found for job: ${job.fullyQualifiedName}`)\n }\n\n q.push({ job, payload }).catch((error) => {\n this.emit('job:error', error, job, payload)\n })\n }\n}\n\n/**\n * In-memory queue driver with no persistence\n * and distributed locking capabilities.\n */\nexport function memory(\n config?: QueueDriverConfig,\n): ConfiguredDriver<MemoryQueueDriver, QueueDriverConfig> {\n return {\n constructor: MemoryQueueDriver,\n config: config,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EAGA;AAAA,OAKK;AACP,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,YAAY,WAAW;AAShB,IAAM,oBAAN,MAAM,2BAA0B,YAAY;AAAA,EASjD,YACE,aACA,SACA,SAA4B,CAAC,GAC7B;AACA,UAAM,aAAa,SAAS,MAAM;AAbpC,wBAAU,UAAS,oBAAI,IAA6B;AAEpD,wBAAU,SAAgC;AAAA,MACxC,WAAW;AAAA,MACX,WAAW;AAAA,MACX,iBAAiB;AAAA,IACnB;AAAA,EAQA;AAAA,EAEO,qBAAqB;AAC1B,SAAK,cAAc,IAAI,YAAY,YAAY,EAAE,QAAQ,CAAC;AAC1D,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMc,aACZ,uBACA,SACe;AAAA;AAnDnB;AAoDI,YAAM,EAAE,cAAc,EAAE,IAAI;AAE5B,YAAM,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU,qBAAqB;AAE3D,UAAI,GAAC,UAAK,WAAL,mBAAa,WAAU,gBAAgB,GAAG;AAC7C,aAAK,OAAO;AAAA,UACV,EAAE,YAAY,KAAK,YAAY,OAAO,KAAK,KAAK;AAAA,UAChD;AAAA,QACF;AAEA;AAAA,MACF;AAEA,UAAI,CAAC,KAAK,OAAO,IAAI,qBAAqB,GAAG;AAC3C,cAAM,IAAgC;AAAA,UACpC;AAAA,UACA,KAAK;AAAA,UACL;AAAA,QACF;AAEA,UAAE,MAAM;AAER,aAAK,OAAO,IAAI,uBAAuB,CAAC;AAAA,MAC1C;AAEA,WAAK,OAAO;AAAA,QACV;AAAA,UACE,YAAY,KAAK;AAAA,UACjB;AA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AM,IAAI,MAAM,6BAA6B;AAAA,MAC/C;AAEA,UAAI,KAAK,MAAM,WAAW;AACxB,cAAM,IAAI;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAEA,YAAM,+CAAM,gBAAN,MAAc,KAAK,OAAO;AAEhC,WAAK,OAAO;AAAA,QACV;AAAA,UACE,YAAY,KAAK;AAAA,UACjB,OAAO,IAAI,QAAQ;AAAA,UACnB,KAAK,IAAI;AAAA,QACX;AAAA,QACA;AAAA,MACF;AAEA,YAAM,IAAI,KAAK,OAAO,IAAI,IAAI,kBAAkB;AAEhD,UAAI,CAAC,GAAG;AACN,cAAM,IAAI,MAAM,4BAA4B,IAAI,kBAAkB,EAAE;AAAA,MACtE;AAEA,QAAE,KAAK,EAAE,KAAK,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU;AACxC,aAAK,KAAK,aAAa,OAAO,KAAK,OAAO;AAAA,MAC5C,CAAC;AAAA,IACH;AAAA;AACF;AAMO,SAAS,OACd,QACwD;AACxD,SAAO;AAAA,IACL,aAAa;AAAA,IACb;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lavoro/memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "In-memory queue driver for Lavoro",
|
|
6
6
|
"author": "Aleksei Ivanov <contact@aleksei.dev>",
|
|
@@ -45,5 +45,8 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@lavoro/core": "*",
|
|
47
47
|
"@verrou/core": "^0.5.2"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"fastq": "^1.19.1"
|
|
48
51
|
}
|
|
49
52
|
}
|