@antelopejs/redis 0.1.0 → 1.0.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 +8 -7
- package/dist/index.d.ts +7 -3
- package/dist/index.js +61 -9
- package/dist/index.js.map +1 -1
- package/dist/test/antelope.test.d.ts +2 -0
- package/dist/test/antelope.test.js +17 -0
- package/dist/test/antelope.test.js.map +1 -0
- package/package.json +25 -28
- package/dist/interfaces/redis/beta/index.d.ts +0 -7
- package/dist/interfaces/redis/beta/index.js +0 -13
- package/dist/interfaces/redis/beta/index.js.map +0 -1
- package/dist/interfaces/redis/dev/index.d.ts +0 -7
- package/dist/interfaces/redis/dev/index.js +0 -13
- package/dist/interfaces/redis/dev/index.js.map +0 -1
- package/dist/interfaces/redis_scheduler/1.d.ts +0 -9
- package/dist/interfaces/redis_scheduler/1.js +0 -112
- package/dist/interfaces/redis_scheduler/1.js.map +0 -1
- package/dist/interfaces/redis_scheduler/beta.d.ts +0 -9
- package/dist/interfaces/redis_scheduler/beta.js +0 -112
- package/dist/interfaces/redis_scheduler/beta.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# @antelopejs/redis
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<div align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@antelopejs/redis"><img alt="NPM version" src="https://img.shields.io/npm/v/@antelopejs/redis.svg?style=for-the-badge&labelColor=000000"></a>
|
|
7
|
+
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/npm/l/@antelopejs/redis.svg?style=for-the-badge&labelColor=000000"></a>
|
|
8
|
+
<a href="https://discord.gg/sjK28QHrA7"><img src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000" alt="Discord"></a>
|
|
9
|
+
<a href="https://antelopejs.com/modules/redis"><img src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000" alt="Documentation"></a>
|
|
10
|
+
</div>
|
|
8
11
|
|
|
9
12
|
A Redis client module that implements the Redis and Redis Scheduler interfaces for AntelopeJS.
|
|
10
13
|
|
|
@@ -42,9 +45,7 @@ The Redis module can be configured with standard Redis client options:
|
|
|
42
45
|
```json
|
|
43
46
|
{
|
|
44
47
|
"url": "redis://localhost:6379",
|
|
45
|
-
"
|
|
46
|
-
"reconnectStrategy": true
|
|
47
|
-
}
|
|
48
|
+
"lazyConnect": true
|
|
48
49
|
}
|
|
49
50
|
```
|
|
50
51
|
|
|
@@ -52,7 +53,7 @@ The Redis module can be configured with standard Redis client options:
|
|
|
52
53
|
|
|
53
54
|
The module accepts the following configuration properties:
|
|
54
55
|
|
|
55
|
-
- All standard Redis client options from the `
|
|
56
|
+
- All standard Redis client options from the `ioredis` package
|
|
56
57
|
- Supports all connection methods including URL string, socket options, etc.
|
|
57
58
|
|
|
58
59
|
## Integration with Other Modules
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { type RedisOptions } from "ioredis";
|
|
2
|
+
export interface RedisConfig extends RedisOptions {
|
|
3
|
+
url?: string;
|
|
4
|
+
useMock?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function construct(config: RedisConfig): void;
|
|
3
7
|
export declare function destroy(): void;
|
|
4
|
-
export declare function start(): void
|
|
8
|
+
export declare function start(): Promise<void>;
|
|
5
9
|
export declare function stop(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.construct = construct;
|
|
4
40
|
exports.destroy = destroy;
|
|
5
41
|
exports.start = start;
|
|
6
42
|
exports.stop = stop;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
43
|
+
const interface_redis_1 = require("@antelopejs/interface-redis");
|
|
44
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
9
45
|
let redisConfig;
|
|
10
46
|
function construct(config) {
|
|
11
47
|
redisConfig = config;
|
|
12
48
|
}
|
|
13
49
|
function destroy() { }
|
|
14
|
-
function start() {
|
|
15
|
-
const client =
|
|
16
|
-
|
|
17
|
-
|
|
50
|
+
async function start() {
|
|
51
|
+
const client = await createRedisClient(redisConfig);
|
|
52
|
+
if (redisConfig.useMock || redisConfig.lazyConnect) {
|
|
53
|
+
await client.connect();
|
|
54
|
+
}
|
|
55
|
+
interface_redis_1.internal.SetClient(client);
|
|
18
56
|
}
|
|
19
57
|
async function stop() {
|
|
20
|
-
const client = await
|
|
21
|
-
await client.
|
|
22
|
-
void
|
|
58
|
+
const client = await interface_redis_1.internal.client;
|
|
59
|
+
await client.quit();
|
|
60
|
+
void interface_redis_1.internal.UnsetClient();
|
|
61
|
+
}
|
|
62
|
+
async function createRedisClient(config) {
|
|
63
|
+
if (config.useMock) {
|
|
64
|
+
const { default: RedisMock } = await Promise.resolve().then(() => __importStar(require("ioredis-mock")));
|
|
65
|
+
return new RedisMock({ lazyConnect: true });
|
|
66
|
+
}
|
|
67
|
+
const { url, useMock: _, ...options } = config;
|
|
68
|
+
if (!url) {
|
|
69
|
+
return new ioredis_1.default(options);
|
|
70
|
+
}
|
|
71
|
+
if (Object.keys(options).length === 0) {
|
|
72
|
+
return new ioredis_1.default(url);
|
|
73
|
+
}
|
|
74
|
+
return new ioredis_1.default(url, options);
|
|
23
75
|
}
|
|
24
76
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,8BAEC;AAED,0BAAkC;AAElC,sBAMC;AAED,oBAIC;AA3BD,iEAAuD;AACvD,sDAAmD;AAOnD,IAAI,WAAwB,CAAC;AAC7B,SAAg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
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_1 = require("@antelopejs/interface-core/config");
|
|
4
|
+
exports.default = (0, config_1.defineConfig)({
|
|
5
|
+
name: "redis-test",
|
|
6
|
+
cacheFolder: ".antelope/cache",
|
|
7
|
+
modules: {
|
|
8
|
+
local: {
|
|
9
|
+
source: { type: "local", path: "." },
|
|
10
|
+
config: { useMock: true },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
test: {
|
|
14
|
+
folder: "dist/test",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=antelope.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antelope.test.js","sourceRoot":"","sources":["../../src/test/antelope.test.ts"],"names":[],"mappings":";;AAAA,8DAAiE;AAEjE,kBAAe,IAAA,qBAAY,EAAC;IAC1B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE;QACP,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE;YACpC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SAC1B;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,WAAW;KACpB;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/redis",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Redis module that implements the redis interface of antelopejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -23,45 +23,42 @@
|
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"packageManager": "pnpm@10.6.5",
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "tsc",
|
|
27
|
-
"dev:prepare": "cd playground && ajs module imports update",
|
|
26
|
+
"build": "rimraf dist && tsc",
|
|
28
27
|
"dev": "ajs project run -w -p playground --inspect",
|
|
29
|
-
"format": "
|
|
30
|
-
"
|
|
31
|
-
"lint
|
|
32
|
-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
28
|
+
"format": "biome format --write .",
|
|
29
|
+
"lint:fix": "biome check --write .",
|
|
30
|
+
"lint": "biome check .",
|
|
33
31
|
"prepack": "pnpm run build",
|
|
34
|
-
"prepare": "ajs module imports update",
|
|
35
32
|
"release": "pnpm run lint && pnpm run test && pnpm run prepack && release-it",
|
|
36
|
-
"test": "
|
|
33
|
+
"test": "ajs module test ."
|
|
37
34
|
},
|
|
38
35
|
"antelopeJs": {
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
"
|
|
36
|
+
"implements": [
|
|
37
|
+
"@antelopejs/interface-redis",
|
|
38
|
+
"@antelopejs/interface-redis-scheduler"
|
|
42
39
|
],
|
|
43
|
-
"importsOptional": [],
|
|
44
40
|
"defaultConfig": {
|
|
45
41
|
"url": "redis://localhost:6379"
|
|
46
|
-
}
|
|
42
|
+
},
|
|
43
|
+
"test": "src/test/antelope.test.ts"
|
|
47
44
|
},
|
|
48
45
|
"dependencies": {
|
|
49
|
-
"
|
|
46
|
+
"@antelopejs/interface-core": "^0.0.2",
|
|
47
|
+
"@antelopejs/interface-redis": "^0.0.2",
|
|
48
|
+
"@antelopejs/interface-redis-scheduler": "^0.0.2",
|
|
49
|
+
"ioredis": "^5.4.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"
|
|
54
|
-
"@
|
|
52
|
+
"@biomejs/biome": "2.3.2",
|
|
53
|
+
"chai": "^4.5.0",
|
|
54
|
+
"@types/chai": "^4.3.20",
|
|
55
|
+
"@types/ioredis-mock": "^8.2.6",
|
|
56
|
+
"@types/mocha": "^10.0.10",
|
|
55
57
|
"@types/node": "^22.14.1",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"globals": "^16.0.0",
|
|
62
|
-
"prettier": "^3.5.3",
|
|
63
|
-
"release-it": "^19.0.2",
|
|
64
|
-
"typescript": "^5.8.3",
|
|
65
|
-
"typescript-eslint": "^8.30.1"
|
|
58
|
+
"ioredis-mock": "^8.13.1",
|
|
59
|
+
"release-it": "^19.2.4",
|
|
60
|
+
"release-it-changelogen": "^0.1.0",
|
|
61
|
+
"rimraf": "^6.0.1",
|
|
62
|
+
"typescript": "^5.8.3"
|
|
66
63
|
}
|
|
67
64
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RedisClientType } from 'redis';
|
|
2
|
-
export declare namespace internal {
|
|
3
|
-
let client: Promise<RedisClientType>;
|
|
4
|
-
let SetClient: (client: RedisClientType) => void;
|
|
5
|
-
const UnsetClient: () => Promise<RedisClientType>;
|
|
6
|
-
}
|
|
7
|
-
export declare function GetClient(): Promise<RedisClientType>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.internal = void 0;
|
|
4
|
-
exports.GetClient = GetClient;
|
|
5
|
-
var internal;
|
|
6
|
-
(function (internal) {
|
|
7
|
-
internal.UnsetClient = () => (internal.client = new Promise((resolve) => (internal.SetClient = resolve)));
|
|
8
|
-
void internal.UnsetClient();
|
|
9
|
-
})(internal || (exports.internal = internal = {}));
|
|
10
|
-
function GetClient() {
|
|
11
|
-
return internal.client;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/redis/beta/index.ts"],"names":[],"mappings":";;;AAuCA,8BAEC;AApCD,IAAiB,QAAQ,CAKxB;AALD,WAAiB,QAAQ;IAGV,oBAAW,GAAG,GAAG,EAAE,CAAC,CAAC,SAAA,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAA,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5F,KAAK,SAAA,WAAW,EAAE,CAAC;AACrB,CAAC,EALgB,QAAQ,wBAAR,QAAQ,QAKxB;AA6BD,SAAgB,SAAS;IACvB,OAAO,QAAQ,CAAC,MAAM,CAAC;AACzB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RedisClientType } from 'redis';
|
|
2
|
-
export declare namespace internal {
|
|
3
|
-
let client: Promise<RedisClientType>;
|
|
4
|
-
let SetClient: (client: RedisClientType) => void;
|
|
5
|
-
const UnsetClient: () => Promise<RedisClientType>;
|
|
6
|
-
}
|
|
7
|
-
export declare function GetClient(): Promise<RedisClientType>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.internal = void 0;
|
|
4
|
-
exports.GetClient = GetClient;
|
|
5
|
-
var internal;
|
|
6
|
-
(function (internal) {
|
|
7
|
-
internal.UnsetClient = () => (internal.client = new Promise((resolve) => (internal.SetClient = resolve)));
|
|
8
|
-
internal.UnsetClient();
|
|
9
|
-
})(internal || (exports.internal = internal = {}));
|
|
10
|
-
function GetClient() {
|
|
11
|
-
return internal.client;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/redis/dev/index.ts"],"names":[],"mappings":";;;AAgDA,8BAEC;AA3CD,IAAiB,QAAQ,CAYxB;AAZD,WAAiB,QAAQ;IASX,oBAAW,GAAG,GAAG,EAAE,CAAC,CAAC,SAAA,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAA,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE5F,SAAA,WAAW,EAAE,CAAC;AACf,CAAC,EAZgB,QAAQ,wBAAR,QAAQ,QAYxB;AA6BD,SAAgB,SAAS;IACxB,OAAO,QAAQ,CAAC,MAAM,CAAC;AACxB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type HandlerType = (taskInfo: string) => void | Promise<void>;
|
|
2
|
-
export declare function setHandler(handlerName: string, handler: HandlerType): void;
|
|
3
|
-
export declare function enableListener(): Promise<void>;
|
|
4
|
-
export declare function disableListener(): Promise<void>;
|
|
5
|
-
export declare function addTask(handlerName: string, dueTime: number, taskInfo: string): Promise<void>;
|
|
6
|
-
export declare function removeTask(handlerName: string, taskInfo: string): Promise<void>;
|
|
7
|
-
export declare function updateTimer(): Promise<void>;
|
|
8
|
-
export declare function runTasks(): Promise<void>;
|
|
9
|
-
export {};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setHandler = setHandler;
|
|
4
|
-
exports.enableListener = enableListener;
|
|
5
|
-
exports.disableListener = disableListener;
|
|
6
|
-
exports.addTask = addTask;
|
|
7
|
-
exports.removeTask = removeTask;
|
|
8
|
-
exports.updateTimer = updateTimer;
|
|
9
|
-
exports.runTasks = runTasks;
|
|
10
|
-
const _1_1 = require("@ajs/core/1");
|
|
11
|
-
const dev_1 = require("@ajs/redis/dev");
|
|
12
|
-
const RedisKey = 'SchedulerUtil.Tasks';
|
|
13
|
-
const handlers = new Map();
|
|
14
|
-
const proxy = new _1_1.RegisteringProxy();
|
|
15
|
-
proxy.onRegister((handlerName, handler) => {
|
|
16
|
-
if (handlerName.indexOf(':') !== -1) {
|
|
17
|
-
throw new Error('SchedulerUtil handler name may not contain `:`');
|
|
18
|
-
}
|
|
19
|
-
handlers.set(handlerName, handler);
|
|
20
|
-
}, true);
|
|
21
|
-
proxy.onUnregister((handlerName) => {
|
|
22
|
-
handlers.delete(handlerName);
|
|
23
|
-
});
|
|
24
|
-
function setHandler(handlerName, handler) {
|
|
25
|
-
proxy.register(handlerName, handler);
|
|
26
|
-
}
|
|
27
|
-
let subscriber;
|
|
28
|
-
async function enableListener() {
|
|
29
|
-
subscriber = (await (0, dev_1.GetClient)()).duplicate();
|
|
30
|
-
await subscriber.subscribe('SchedulerUtil', (message, channel) => {
|
|
31
|
-
if (channel === 'SchedulerUtil') {
|
|
32
|
-
switch (message) {
|
|
33
|
-
case 'update':
|
|
34
|
-
updateTimer();
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
updateTimer();
|
|
40
|
-
}
|
|
41
|
-
async function disableListener() {
|
|
42
|
-
await subscriber.disconnect();
|
|
43
|
-
}
|
|
44
|
-
async function addTask(handlerName, dueTime, taskInfo) {
|
|
45
|
-
if (!handlers.has(handlerName)) {
|
|
46
|
-
throw new Error('Unknown SchedulerUtil handler: ' + handlerName);
|
|
47
|
-
}
|
|
48
|
-
const client = await (0, dev_1.GetClient)();
|
|
49
|
-
await client.zAdd(RedisKey, { score: dueTime, value: handlerName + ':' + taskInfo });
|
|
50
|
-
if (!locked) {
|
|
51
|
-
client.publish('SchedulerUtil', 'update');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async function removeTask(handlerName, taskInfo) {
|
|
55
|
-
if (!handlers.has(handlerName)) {
|
|
56
|
-
throw new Error('Unknown SchedulerUtil handler: ' + handlerName);
|
|
57
|
-
}
|
|
58
|
-
const client = await (0, dev_1.GetClient)();
|
|
59
|
-
await client.zRem(RedisKey, taskInfo);
|
|
60
|
-
}
|
|
61
|
-
let locked = false;
|
|
62
|
-
let timer;
|
|
63
|
-
async function updateTimer() {
|
|
64
|
-
if (locked) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const client = await (0, dev_1.GetClient)();
|
|
68
|
-
const taskInfo = (await client.zRange(RedisKey, 0, 0))[0];
|
|
69
|
-
if (taskInfo) {
|
|
70
|
-
const score = (await client.zScore(RedisKey, taskInfo));
|
|
71
|
-
if (score < Date.now()) {
|
|
72
|
-
await runTasks();
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
if (timer) {
|
|
76
|
-
clearTimeout(timer);
|
|
77
|
-
}
|
|
78
|
-
timer = setTimeout(() => runTasks(), score - Date.now());
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async function runTasks() {
|
|
83
|
-
locked = true;
|
|
84
|
-
const client = await (0, dev_1.GetClient)();
|
|
85
|
-
const tasks = await client.zRange(RedisKey, Date.now(), 0, { REV: true, BY: 'SCORE' });
|
|
86
|
-
if (tasks.length > 0) {
|
|
87
|
-
await client.zRem(RedisKey, tasks);
|
|
88
|
-
for (const task of tasks) {
|
|
89
|
-
const m = task.match(/^(?:RETRY-(\d)+:)?([^:]*):(.*)$/);
|
|
90
|
-
try {
|
|
91
|
-
if (m && handlers.has(m[2])) {
|
|
92
|
-
await handlers.get(m[2])(m[3]);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
console.error(err);
|
|
97
|
-
if (m) {
|
|
98
|
-
const retryCount = m[1] ? parseInt(m[1]) : 0;
|
|
99
|
-
if (retryCount < 3) {
|
|
100
|
-
await client.zAdd(RedisKey, {
|
|
101
|
-
score: Date.now() + 5000,
|
|
102
|
-
value: `RETRY-${retryCount + 1}:${m[2]}:${m[3]}`,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
locked = false;
|
|
110
|
-
await updateTimer();
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=1.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1.js","sourceRoot":"","sources":["../../../src/interfaces/redis_scheduler/1.ts"],"names":[],"mappings":";;AAgDA,gCAEC;AAwBD,w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AC,CAAC;gBACjC,CAAC;YACF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnB,IAAI,CAAC,EAAE,CAAC;oBACP,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7C,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;wBACpB,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE;4BAC3B,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI;4BACxB,KAAK,EAAE,SAAS,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;yBAChD,CAAC,CAAC;oBACJ,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IACD,MAAM,GAAG,KAAK,CAAC;IACf,MAAM,WAAW,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type HandlerType = (taskInfo: string) => void | Promise<void>;
|
|
2
|
-
export declare function setHandler(handlerName: string, handler: HandlerType): void;
|
|
3
|
-
export declare function enableListener(): Promise<void>;
|
|
4
|
-
export declare function disableListener(): Promise<void>;
|
|
5
|
-
export declare function addTask(handlerName: string, dueTime: number, taskInfo: string): Promise<void>;
|
|
6
|
-
export declare function removeTask(handlerName: string, taskInfo: string): Promise<void>;
|
|
7
|
-
export declare function updateTimer(): Promise<void>;
|
|
8
|
-
export declare function runTasks(): Promise<void>;
|
|
9
|
-
export {};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setHandler = setHandler;
|
|
4
|
-
exports.enableListener = enableListener;
|
|
5
|
-
exports.disableListener = disableListener;
|
|
6
|
-
exports.addTask = addTask;
|
|
7
|
-
exports.removeTask = removeTask;
|
|
8
|
-
exports.updateTimer = updateTimer;
|
|
9
|
-
exports.runTasks = runTasks;
|
|
10
|
-
const beta_1 = require("@ajs/core/beta");
|
|
11
|
-
const beta_2 = require("@ajs.local/redis/beta");
|
|
12
|
-
const RedisKey = 'SchedulerUtil.Tasks';
|
|
13
|
-
const handlers = new Map();
|
|
14
|
-
const proxy = new beta_1.RegisteringProxy();
|
|
15
|
-
proxy.onRegister((handlerName, handler) => {
|
|
16
|
-
if (handlerName.indexOf(':') !== -1) {
|
|
17
|
-
throw new Error('SchedulerUtil handler name may not contain `:`');
|
|
18
|
-
}
|
|
19
|
-
handlers.set(handlerName, handler);
|
|
20
|
-
}, true);
|
|
21
|
-
proxy.onUnregister((handlerName) => {
|
|
22
|
-
handlers.delete(handlerName);
|
|
23
|
-
});
|
|
24
|
-
function setHandler(handlerName, handler) {
|
|
25
|
-
proxy.register(handlerName, handler);
|
|
26
|
-
}
|
|
27
|
-
let subscriber;
|
|
28
|
-
async function enableListener() {
|
|
29
|
-
subscriber = (await (0, beta_2.GetClient)()).duplicate();
|
|
30
|
-
await subscriber.subscribe('SchedulerUtil', (message, channel) => {
|
|
31
|
-
if (channel === 'SchedulerUtil') {
|
|
32
|
-
switch (message) {
|
|
33
|
-
case 'update':
|
|
34
|
-
void updateTimer();
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
void updateTimer();
|
|
40
|
-
}
|
|
41
|
-
async function disableListener() {
|
|
42
|
-
await subscriber.disconnect();
|
|
43
|
-
}
|
|
44
|
-
async function addTask(handlerName, dueTime, taskInfo) {
|
|
45
|
-
if (!handlers.has(handlerName)) {
|
|
46
|
-
throw new Error('Unknown SchedulerUtil handler: ' + handlerName);
|
|
47
|
-
}
|
|
48
|
-
const client = await (0, beta_2.GetClient)();
|
|
49
|
-
await client.zAdd(RedisKey, { score: dueTime, value: handlerName + ':' + taskInfo });
|
|
50
|
-
if (!locked) {
|
|
51
|
-
void client.publish('SchedulerUtil', 'update');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async function removeTask(handlerName, taskInfo) {
|
|
55
|
-
if (!handlers.has(handlerName)) {
|
|
56
|
-
throw new Error('Unknown SchedulerUtil handler: ' + handlerName);
|
|
57
|
-
}
|
|
58
|
-
const client = await (0, beta_2.GetClient)();
|
|
59
|
-
await client.zRem(RedisKey, taskInfo);
|
|
60
|
-
}
|
|
61
|
-
let locked = false;
|
|
62
|
-
let timer;
|
|
63
|
-
async function updateTimer() {
|
|
64
|
-
if (locked) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const client = await (0, beta_2.GetClient)();
|
|
68
|
-
const taskInfo = (await client.zRange(RedisKey, 0, 0))[0];
|
|
69
|
-
if (taskInfo) {
|
|
70
|
-
const score = (await client.zScore(RedisKey, taskInfo));
|
|
71
|
-
if (score < Date.now()) {
|
|
72
|
-
await runTasks();
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
if (timer) {
|
|
76
|
-
clearTimeout(timer);
|
|
77
|
-
}
|
|
78
|
-
timer = setTimeout(() => void runTasks(), Math.min(score - Date.now(), 86400000));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async function runTasks() {
|
|
83
|
-
locked = true;
|
|
84
|
-
const client = await (0, beta_2.GetClient)();
|
|
85
|
-
const tasks = await client.zRange(RedisKey, Date.now(), 0, { REV: true, BY: 'SCORE' });
|
|
86
|
-
if (tasks.length > 0) {
|
|
87
|
-
await client.zRem(RedisKey, tasks);
|
|
88
|
-
for (const task of tasks) {
|
|
89
|
-
const m = task.match(/^(?:RETRY-(\d)+:)?([^:]*):(.*)$/);
|
|
90
|
-
try {
|
|
91
|
-
if (m && handlers.has(m[2])) {
|
|
92
|
-
await handlers.get(m[2])(m[3]);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
console.error(err);
|
|
97
|
-
if (m) {
|
|
98
|
-
const retryCount = m[1] ? parseInt(m[1]) : 0;
|
|
99
|
-
if (retryCount < 3) {
|
|
100
|
-
await client.zAdd(RedisKey, {
|
|
101
|
-
score: Date.now() + 5000,
|
|
102
|
-
value: `RETRY-${retryCount + 1}:${m[2]}:${m[3]}`,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
locked = false;
|
|
110
|
-
await updateTimer();
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=beta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../../src/interfaces/redis_scheduler/beta.ts"],"names":[],"mappings":";;AAgDA,gCAEC;AAwBD,wCAcC;AAiBD,0CAEC;AA8BD,0BAUC;AA0BD,gCAMC;AAWD,kCAkBC;AAOD,4BA4BC;AAnPD,yCAAkD;AAClD,gDAAkD;AAUlD,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAGvC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;AAEhD,MAAM,KAAK,GAAG,IAAI,uBAAgB,EAAuD,CAAC;AAC1F,KAAK,CAAC,UAAU,CAAC,CAAC,WAAmB,EAAE,OAAoB,EAAE,EAAE;IAC7D,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC,EAAE,IAAI,CAAC,CAAC;AACT,KAAK,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,EAAE;IACjC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC/B,CAAC,CAA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