@imqueue/core 1.13.2 → 2.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/LICENSE +585 -13
- package/README.md +2 -1
- package/eslint.config.mjs +98 -0
- package/index.d.ts +17 -11
- package/index.js +18 -12
- package/package.json +26 -21
- package/src/ClusterManager.d.ts +34 -0
- package/src/ClusterManager.js +13 -0
- package/src/ClusteredRedisQueue.d.ts +61 -22
- package/src/ClusteredRedisQueue.js +157 -31
- package/src/IMQMode.d.ts +17 -11
- package/src/IMQMode.js +17 -11
- package/src/IMessageQueue.d.ts +86 -30
- package/src/RedisQueue.d.ts +44 -41
- package/src/RedisQueue.js +160 -115
- package/src/UDPClusterManager.d.ts +82 -0
- package/src/UDPClusterManager.js +154 -0
- package/src/copyEventEmitter.d.ts +28 -0
- package/src/copyEventEmitter.js +23 -0
- package/src/index.d.ts +20 -11
- package/src/index.js +21 -13
- package/src/profile.d.ts +17 -11
- package/src/profile.js +21 -15
- package/src/promisify.d.ts +18 -11
- package/src/promisify.js +21 -15
- package/src/redis.d.ts +25 -24
- package/src/redis.js +44 -22
- package/src/uuid.js +18 -13
- package/debug.d.ts +0 -0
- package/tslint.json +0 -77
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* I'm Queue Software Project
|
|
3
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*
|
|
18
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
19
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
20
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
21
|
+
*/
|
|
22
|
+
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
|
|
23
|
+
import tsParser from "@typescript-eslint/parser";
|
|
24
|
+
import path from "node:path";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
|
+
import js from "@eslint/js";
|
|
27
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
28
|
+
|
|
29
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
30
|
+
const __dirname = path.dirname(__filename);
|
|
31
|
+
const compat = new FlatCompat({
|
|
32
|
+
baseDirectory: __dirname,
|
|
33
|
+
recommendedConfig: js.configs.recommended,
|
|
34
|
+
allConfig: js.configs.all
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export default [...compat.extends(
|
|
38
|
+
"plugin:@typescript-eslint/recommended",
|
|
39
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
40
|
+
), {
|
|
41
|
+
plugins: {
|
|
42
|
+
"@typescript-eslint": typescriptEslintEslintPlugin,
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
languageOptions: {
|
|
46
|
+
parser: tsParser,
|
|
47
|
+
ecmaVersion: 5,
|
|
48
|
+
sourceType: "module",
|
|
49
|
+
|
|
50
|
+
parserOptions: {
|
|
51
|
+
project: "tsconfig.json",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
rules: {
|
|
56
|
+
"@typescript-eslint/interface-name-prefix": "off",
|
|
57
|
+
"@typescript-eslint/explicit-function-return-type": ["warn"],
|
|
58
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
59
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
60
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
61
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
62
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
63
|
+
"no-trailing-spaces": "warn",
|
|
64
|
+
"no-unused-vars": "off",
|
|
65
|
+
"@typescript-eslint/no-unused-vars": ["warn"],
|
|
66
|
+
"semi": ["warn", "always"],
|
|
67
|
+
|
|
68
|
+
"no-console": ["warn", {
|
|
69
|
+
allow: ["warn", "error", "info"],
|
|
70
|
+
}],
|
|
71
|
+
|
|
72
|
+
"no-debugger": "error",
|
|
73
|
+
"arrow-parens": ["warn", "as-needed"],
|
|
74
|
+
|
|
75
|
+
"quotes": ["error", "single", {
|
|
76
|
+
avoidEscape: true,
|
|
77
|
+
allowTemplateLiterals: true,
|
|
78
|
+
}],
|
|
79
|
+
|
|
80
|
+
"comma-dangle": ["warn", {
|
|
81
|
+
arrays: "always-multiline",
|
|
82
|
+
objects: "always-multiline",
|
|
83
|
+
imports: "always-multiline",
|
|
84
|
+
exports: "always-multiline",
|
|
85
|
+
functions: "always-multiline",
|
|
86
|
+
}],
|
|
87
|
+
|
|
88
|
+
"max-len": ["warn", {
|
|
89
|
+
code: 80,
|
|
90
|
+
ignoreComments: true,
|
|
91
|
+
ignoreRegExpLiterals: true,
|
|
92
|
+
ignoreTrailingComments: true,
|
|
93
|
+
ignoreTemplateLiterals: true,
|
|
94
|
+
ignoreStrings: true,
|
|
95
|
+
ignoreUrls: true,
|
|
96
|
+
}],
|
|
97
|
+
},
|
|
98
|
+
}];
|
package/index.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Message Queue factory for @imqueue/core
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* I'm Queue Software Project
|
|
5
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*
|
|
20
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
21
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
22
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
17
23
|
*/
|
|
18
24
|
import 'reflect-metadata';
|
|
19
25
|
import { IMessageQueue, IMQMode, IMQOptions } from './src';
|
package/index.js
CHANGED
|
@@ -17,19 +17,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
/*!
|
|
18
18
|
* Message Queue factory for @imqueue/core
|
|
19
19
|
*
|
|
20
|
-
*
|
|
20
|
+
* I'm Queue Software Project
|
|
21
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* This program is free software: you can redistribute it and/or modify
|
|
24
|
+
* it under the terms of the GNU General Public License as published by
|
|
25
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
26
|
+
* (at your option) any later version.
|
|
25
27
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* This program is distributed in the hope that it will be useful,
|
|
29
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
30
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
31
|
+
* GNU General Public License for more details.
|
|
32
|
+
*
|
|
33
|
+
* You should have received a copy of the GNU General Public License
|
|
34
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
35
|
+
*
|
|
36
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
37
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
38
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
33
39
|
*/
|
|
34
40
|
require("reflect-metadata");
|
|
35
41
|
const src_1 = require("./src");
|
|
@@ -49,7 +55,7 @@ class IMQ {
|
|
|
49
55
|
static create(name, options = {}, mode = src_1.IMQMode.BOTH) {
|
|
50
56
|
options = Object.assign({}, IMQ.options, options);
|
|
51
57
|
let ClassName = `${options.vendor}Queue`;
|
|
52
|
-
if (options.cluster) {
|
|
58
|
+
if (options.cluster || options.clusterManagers) {
|
|
53
59
|
ClassName = `Clustered${ClassName}`;
|
|
54
60
|
}
|
|
55
61
|
const Adapter = require(`${__dirname}/src/${ClassName}.js`)[ClassName];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imqueue/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Simple JSON-based messaging queue for inter service communication",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"message-queue",
|
|
@@ -35,33 +35,38 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://imqueue.com/",
|
|
37
37
|
"author": "imqueue.com <support@imqueue.com> (https://imqueue.com)",
|
|
38
|
-
"license": "
|
|
38
|
+
"license": "GPL-3.0-only",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"
|
|
41
|
-
"redis": "3.1.2"
|
|
40
|
+
"ioredis": "^5.6.1"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@types/
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/
|
|
49
|
-
"@types/
|
|
50
|
-
"
|
|
43
|
+
"@eslint/js": "^9.30.0",
|
|
44
|
+
"@types/chai": "^5.2.2",
|
|
45
|
+
"@types/eslint__eslintrc": "^2.1.2",
|
|
46
|
+
"@types/mocha": "^10.0.0",
|
|
47
|
+
"@types/mock-require": "^3.0.0",
|
|
48
|
+
"@types/node": "^24.0.8",
|
|
49
|
+
"@types/sinon": "^17.0.4",
|
|
50
|
+
"@types/yargs": "^17.0.33",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
|
52
|
+
"@typescript-eslint/parser": "^8.35.1",
|
|
53
|
+
"@typescript-eslint/typescript-estree": "^8.35.1",
|
|
54
|
+
"chai": "^5.2.0",
|
|
51
55
|
"codeclimate-test-reporter": "^0.5.1",
|
|
52
|
-
"coveralls": "^
|
|
53
|
-
"
|
|
56
|
+
"coveralls-next": "^4.2.1",
|
|
57
|
+
"eslint": "^9.30.0",
|
|
58
|
+
"eslint-plugin-jsdoc": "^51.3.1",
|
|
59
|
+
"mocha": "^11.7.1",
|
|
54
60
|
"mocha-lcov-reporter": "^1.3.0",
|
|
55
61
|
"mock-require": "^3.0.3",
|
|
56
|
-
"nyc": "^
|
|
57
|
-
"open": "^
|
|
58
|
-
"reflect-metadata": "^0.
|
|
59
|
-
"sinon": "^
|
|
62
|
+
"nyc": "^17.1.0",
|
|
63
|
+
"open": "^10.1.2",
|
|
64
|
+
"reflect-metadata": "^0.2.2",
|
|
65
|
+
"sinon": "^21.0.0",
|
|
60
66
|
"source-map-support": "^0.5.21",
|
|
61
|
-
"ts-node": "^10.9.
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"typescript": "^5.2.2",
|
|
67
|
+
"ts-node": "^10.9.2",
|
|
68
|
+
"typedoc": "^0.28.7",
|
|
69
|
+
"typescript": "^5.8.3",
|
|
65
70
|
"yargs": "^17.7.2"
|
|
66
71
|
},
|
|
67
72
|
"main": "index.js",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Clustered messaging queue over Redis implementation
|
|
3
|
+
*
|
|
4
|
+
* I'm Queue Software Project
|
|
5
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*
|
|
20
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
21
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
22
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
23
|
+
*/
|
|
24
|
+
import { IMessageQueueConnection, IServerInput } from './IMessageQueue';
|
|
25
|
+
export interface ICluster {
|
|
26
|
+
add: (server: IServerInput) => void;
|
|
27
|
+
remove: (server: IServerInput) => void;
|
|
28
|
+
find: <T extends IMessageQueueConnection>(server: IServerInput) => T | undefined;
|
|
29
|
+
}
|
|
30
|
+
export declare abstract class ClusterManager {
|
|
31
|
+
protected clusters: ICluster[];
|
|
32
|
+
protected constructor();
|
|
33
|
+
init(cluster: ICluster): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClusterManager = void 0;
|
|
4
|
+
class ClusterManager {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.clusters = [];
|
|
7
|
+
}
|
|
8
|
+
init(cluster) {
|
|
9
|
+
this.clusters.push(cluster);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.ClusterManager = ClusterManager;
|
|
13
|
+
//# sourceMappingURL=ClusterManager.js.map
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/*!
|
|
3
2
|
* Clustered messaging queue over Redis implementation
|
|
4
3
|
*
|
|
5
|
-
*
|
|
4
|
+
* I'm Queue Software Project
|
|
5
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*
|
|
20
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
21
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
22
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
18
23
|
*/
|
|
19
24
|
import { EventEmitter } from 'events';
|
|
20
|
-
import { ILogger, IMessageQueue, IMQMode, IMQOptions, JsonObject } from '.';
|
|
25
|
+
import { ILogger, IMessageQueue, IMQMode, IMQOptions, JsonObject, EventMap, IServerInput } from '.';
|
|
21
26
|
/**
|
|
22
27
|
* Class ClusteredRedisQueue
|
|
23
|
-
*
|
|
28
|
+
* Implements the possibility to scale queues horizontally between several
|
|
24
29
|
* redis instances.
|
|
25
30
|
*/
|
|
26
|
-
export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter {
|
|
31
|
+
export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter<EventMap> {
|
|
27
32
|
name: string;
|
|
28
33
|
/**
|
|
29
34
|
* Logger instance associated with this queue instance
|
|
@@ -47,15 +52,15 @@ export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter
|
|
|
47
52
|
* Part of options without cluster definitions - which are generic for
|
|
48
53
|
* RedisQueue instances
|
|
49
54
|
*
|
|
50
|
-
* @type {IMQOptions
|
|
55
|
+
* @type {IMQOptions}
|
|
51
56
|
*/
|
|
52
57
|
private readonly mqOptions;
|
|
53
58
|
/**
|
|
54
59
|
* Cluster servers option definitions
|
|
55
60
|
*
|
|
56
|
-
* @type {
|
|
61
|
+
* @type {IMessageQueueConnection[]}
|
|
57
62
|
*/
|
|
58
|
-
private
|
|
63
|
+
private servers;
|
|
59
64
|
/**
|
|
60
65
|
* Current queue index (round-robin)
|
|
61
66
|
*
|
|
@@ -68,13 +73,28 @@ export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter
|
|
|
68
73
|
* @type {number}
|
|
69
74
|
*/
|
|
70
75
|
private queueLength;
|
|
76
|
+
/**
|
|
77
|
+
* Template EventEmitter instance used to replicate queue EventEmitters when
|
|
78
|
+
* dynamically modifying the cluster
|
|
79
|
+
* @type {EventEmitter}
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
private readonly templateEmitter;
|
|
83
|
+
/**
|
|
84
|
+
* Cluster EventEmitter instance used to notify about changes of
|
|
85
|
+
* cluster servers
|
|
86
|
+
* @type {EventEmitter}
|
|
87
|
+
* @private
|
|
88
|
+
*/
|
|
89
|
+
private readonly clusterEmitter;
|
|
90
|
+
private state;
|
|
71
91
|
/**
|
|
72
92
|
* Class constructor
|
|
73
93
|
*
|
|
74
94
|
* @constructor
|
|
75
95
|
* @param {string} name
|
|
76
96
|
* @param {Partial<IMQOptions>} options
|
|
77
|
-
* @param {IMQMode} mode
|
|
97
|
+
* @param {IMQMode} [mode]
|
|
78
98
|
*/
|
|
79
99
|
constructor(name: string, options?: Partial<IMQOptions>, mode?: IMQMode);
|
|
80
100
|
/**
|
|
@@ -85,7 +105,7 @@ export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter
|
|
|
85
105
|
*/
|
|
86
106
|
start(): Promise<ClusteredRedisQueue>;
|
|
87
107
|
/**
|
|
88
|
-
* Stops the queue (should stop
|
|
108
|
+
* Stops the queue (should stop handling queue messages).
|
|
89
109
|
* Supposed to be an async function.
|
|
90
110
|
*
|
|
91
111
|
* @returns {Promise<ClusteredRedisQueue>}
|
|
@@ -97,8 +117,8 @@ export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter
|
|
|
97
117
|
*
|
|
98
118
|
* @param {string} toQueue - queue name to which message should be sent to
|
|
99
119
|
* @param {JsonObject} message - message data
|
|
100
|
-
* @param {number} [delay] - if specified, message will be handled in the
|
|
101
|
-
* target queue after specified period of time in milliseconds.
|
|
120
|
+
* @param {number} [delay] - if specified, a message will be handled in the
|
|
121
|
+
* target queue after a specified period of time in milliseconds.
|
|
102
122
|
* @param {(err: Error) => void} [errorHandler] - callback called only when
|
|
103
123
|
* internal error occurs during message send execution.
|
|
104
124
|
* @returns {Promise<string>} - message identifier
|
|
@@ -146,4 +166,23 @@ export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter
|
|
|
146
166
|
publish(data: JsonObject, toName?: string): Promise<void>;
|
|
147
167
|
subscribe(channel: string, handler: (data: JsonObject) => any): Promise<void>;
|
|
148
168
|
unsubscribe(): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Adds new servers to the cluster
|
|
171
|
+
*
|
|
172
|
+
* @param {IServerInput} server
|
|
173
|
+
* @returns {void}
|
|
174
|
+
*/
|
|
175
|
+
protected addServer(server: IServerInput): void;
|
|
176
|
+
/**
|
|
177
|
+
* Removes server from the cluster
|
|
178
|
+
*
|
|
179
|
+
* @param {IServerInput} server
|
|
180
|
+
* @returns {void}
|
|
181
|
+
*/
|
|
182
|
+
protected removeServer(server: IServerInput): void;
|
|
183
|
+
private addServerWithQueueInitializing;
|
|
184
|
+
private eventEmitters;
|
|
185
|
+
private initializeQueue;
|
|
186
|
+
private findServer;
|
|
187
|
+
private static matchServers;
|
|
149
188
|
}
|