@lavoro/memory 0.3.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 +14 -0
- package/build/index.js +25 -0
- package/build/index.js.map +1 -0
- package/package.json +46 -0
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueueDriver, QueueConfig, WorkerOptions, QueueDriverConfig, ConfiguredDriver } from '@lavoro/core';
|
|
2
|
+
import { LockFactory } from '@verrou/core';
|
|
3
|
+
|
|
4
|
+
declare class MemoryQueueDriver extends QueueDriver {
|
|
5
|
+
constructor(queueConfig: QueueConfig, options: Record<string, WorkerOptions>, config?: QueueDriverConfig);
|
|
6
|
+
createLockProvider(): LockFactory;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* In-memory queue driver with no persistence
|
|
10
|
+
* and distributed locking capabilities.
|
|
11
|
+
*/
|
|
12
|
+
declare function memory(config?: QueueDriverConfig): ConfiguredDriver<MemoryQueueDriver, QueueDriverConfig>;
|
|
13
|
+
|
|
14
|
+
export { MemoryQueueDriver, memory };
|
package/build/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
QueueDriver
|
|
4
|
+
} from "@lavoro/core";
|
|
5
|
+
import { LockFactory } from "@verrou/core";
|
|
6
|
+
import { memoryStore } from "@verrou/core/drivers/memory";
|
|
7
|
+
var MemoryQueueDriver = class extends QueueDriver {
|
|
8
|
+
constructor(queueConfig, options, config = {}) {
|
|
9
|
+
super(queueConfig, options, config);
|
|
10
|
+
}
|
|
11
|
+
createLockProvider() {
|
|
12
|
+
return new LockFactory(memoryStore().factory());
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
function memory(config) {
|
|
16
|
+
return {
|
|
17
|
+
constructor: MemoryQueueDriver,
|
|
18
|
+
config
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
MemoryQueueDriver,
|
|
23
|
+
memory
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n QueueDriver,\n QueueDriverConfig,\n ConfiguredDriver,\n QueueConfig,\n WorkerOptions,\n} from '@lavoro/core'\n\nimport { LockFactory } from '@verrou/core'\nimport { memoryStore } from '@verrou/core/drivers/memory'\n\nexport class MemoryQueueDriver extends QueueDriver {\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 return new LockFactory(memoryStore().factory())\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,EACE;AAAA,OAKK;AAEP,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAErB,IAAM,oBAAN,cAAgC,YAAY;AAAA,EACjD,YACE,aACA,SACA,SAA4B,CAAC,GAC7B;AACA,UAAM,aAAa,SAAS,MAAM;AAAA,EACpC;AAAA,EAEO,qBAAqB;AAC1B,WAAO,IAAI,YAAY,YAAY,EAAE,QAAQ,CAAC;AAAA,EAChD;AACF;AAMO,SAAS,OACd,QACwD;AACxD,SAAO;AAAA,IACL,aAAa;AAAA,IACb;AAAA,EACF;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lavoro/memory",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "In-memory queue driver for Lavoro",
|
|
6
|
+
"author": "Aleksei Ivanov <contact@aleksei.dev>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/lexuzieel/lavoro.git",
|
|
14
|
+
"directory": "packages/memory"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/lexuzieel/lavoro#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/lexuzieel/lavoro/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"queue",
|
|
22
|
+
"memory",
|
|
23
|
+
"in-memory",
|
|
24
|
+
"lavoro",
|
|
25
|
+
"driver"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./build/index.d.ts",
|
|
30
|
+
"import": "./build/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"main": "build/index.js",
|
|
34
|
+
"files": [
|
|
35
|
+
"build"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"check": "tsc --noEmit",
|
|
39
|
+
"build": "tsup-node",
|
|
40
|
+
"watch": "tsup-node --watch"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@lavoro/core": "*",
|
|
44
|
+
"@verrou/core": "^0.5.2"
|
|
45
|
+
}
|
|
46
|
+
}
|