@imqueue/rpc 2.1.0 → 3.1.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 +68 -0
- package/package.json +26 -61
- package/src/IMQCache.d.ts +10 -9
- package/src/IMQCache.js +16 -22
- package/src/IMQClient.d.ts +21 -16
- package/src/IMQClient.js +466 -270
- package/src/IMQDelay.d.ts +14 -0
- package/src/IMQDelay.js +26 -5
- package/src/IMQLock.d.ts +17 -15
- package/src/IMQLock.js +36 -36
- package/src/IMQMetadata.d.ts +8 -0
- package/src/IMQMetadata.js +8 -0
- package/src/IMQRPCDescription.d.ts +2 -2
- package/src/IMQRPCDescription.js +2 -2
- package/src/IMQRPCError.d.ts +7 -7
- package/src/IMQRPCError.js +7 -8
- package/src/IMQRPCOptions.d.ts +27 -3
- package/src/IMQRPCOptions.js +17 -3
- package/src/IMQRPCRequest.d.ts +1 -1
- package/src/IMQRPCResponse.d.ts +1 -1
- package/src/IMQRequestContext.js +1 -2
- package/src/IMQService.d.ts +3 -4
- package/src/IMQService.js +302 -220
- package/src/cache/ICache.d.ts +53 -0
- package/src/cache/RedisCache.d.ts +36 -31
- package/src/cache/RedisCache.js +104 -61
- package/src/decorators/cache.d.ts +12 -0
- package/src/decorators/cache.js +56 -41
- package/src/decorators/classType.d.ts +43 -0
- package/src/decorators/classType.js +83 -0
- package/src/decorators/expose.d.ts +5 -31
- package/src/decorators/expose.js +147 -129
- package/src/decorators/index.d.ts +2 -0
- package/src/decorators/index.js +4 -0
- package/src/decorators/indexed.d.ts +23 -0
- package/src/decorators/indexed.js +22 -13
- package/src/decorators/lock.d.ts +10 -11
- package/src/decorators/lock.js +63 -56
- package/src/decorators/logged.d.ts +11 -9
- package/src/decorators/logged.js +47 -40
- package/src/decorators/metadata.d.ts +24 -0
- package/src/decorators/metadata.js +45 -0
- package/src/decorators/property.d.ts +7 -57
- package/src/decorators/property.js +112 -83
- package/src/decorators/remote.d.ts +7 -7
- package/src/decorators/remote.js +19 -13
- package/src/helpers/fs.d.ts +13 -13
- package/src/helpers/fs.js +19 -19
- package/src/helpers/os-uuid.d.ts +2 -1
- package/src/helpers/os-uuid.js +86 -3
- package/src/helpers/pid.d.ts +19 -9
- package/src/helpers/pid.js +33 -33
- package/src/helpers/signature.d.ts +9 -7
- package/src/helpers/signature.js +80 -10
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/tsconfig.json +18 -14
- package/.github/workflows/build.yml +0 -28
- package/debug.d.ts +0 -1
package/README.md
CHANGED
|
@@ -179,6 +179,74 @@ import { hello } from './clients/Hello';
|
|
|
179
179
|
In this case all complex types defined within service implementation
|
|
180
180
|
will be available under imported namespace of the client.
|
|
181
181
|
|
|
182
|
+
## Complex Types
|
|
183
|
+
|
|
184
|
+
To expose complex (object) types as service method arguments or return values,
|
|
185
|
+
annotate the class with `@classType()` and its fields with `@property()`:
|
|
186
|
+
|
|
187
|
+
~~~typescript
|
|
188
|
+
import { classType, property, expose, IMQService } from '@imqueue/rpc';
|
|
189
|
+
|
|
190
|
+
@classType()
|
|
191
|
+
class Address {
|
|
192
|
+
@property('string')
|
|
193
|
+
country: string;
|
|
194
|
+
|
|
195
|
+
@property('string', true)
|
|
196
|
+
zipCode?: string; // optional
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@classType()
|
|
200
|
+
class User {
|
|
201
|
+
@property('string')
|
|
202
|
+
firstName: string;
|
|
203
|
+
|
|
204
|
+
@property('Array<Address>', true)
|
|
205
|
+
addresses?: Address[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
class UserService extends IMQService {
|
|
209
|
+
/**
|
|
210
|
+
* Persists the given user
|
|
211
|
+
*
|
|
212
|
+
* @param {User} user - user to save
|
|
213
|
+
* @returns {Promise<boolean>}
|
|
214
|
+
*/
|
|
215
|
+
@expose()
|
|
216
|
+
public async save(user: User): Promise<boolean> {
|
|
217
|
+
// User and Address are now exposed to generated clients
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
~~~
|
|
222
|
+
|
|
223
|
+
The `@classType()` class decorator is **required** on every class that uses
|
|
224
|
+
`@property()` — without it the type will not be registered and will not appear
|
|
225
|
+
in generated clients. (Indexed types use `@indexed()`, which registers `@property`
|
|
226
|
+
fields as well.)
|
|
227
|
+
|
|
228
|
+
## Requirements
|
|
229
|
+
|
|
230
|
+
This package uses **standard (TC39) decorators**. Consuming projects must set,
|
|
231
|
+
in their `tsconfig.json`:
|
|
232
|
+
|
|
233
|
+
~~~json
|
|
234
|
+
{
|
|
235
|
+
"compilerOptions": {
|
|
236
|
+
"experimentalDecorators": false,
|
|
237
|
+
"removeComments": false,
|
|
238
|
+
"lib": ["es2023", "esnext.decorators"]
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
~~~
|
|
242
|
+
|
|
243
|
+
Because standard decorators provide no runtime type reflection (there is no
|
|
244
|
+
`emitDecoratorMetadata`), the RPC layer derives argument and return types from
|
|
245
|
+
**JSDoc**. Therefore **every exposed method must be documented with JSDoc**
|
|
246
|
+
`@param`/`@returns` tags carrying the types (as shown in the examples above),
|
|
247
|
+
and `removeComments` must remain `false` so those comments survive compilation.
|
|
248
|
+
Undocumented parameters fall back to `any` in generated clients.
|
|
249
|
+
|
|
182
250
|
## Notes
|
|
183
251
|
|
|
184
252
|
For image containers builds assign machine UUID in `/etc/machine-id` and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imqueue/rpc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "RPC-like client-service implementation over messaging queue",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"redis",
|
|
@@ -13,18 +13,24 @@
|
|
|
13
13
|
"message-queue"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
16
|
+
"clean-compiled": "npm run clean-js && npm run clean-typedefs && npm run clean-maps",
|
|
17
|
+
"build:deps": "if [ -f ../core/package.json ]; then npm run build --prefix ../core; fi",
|
|
18
|
+
"build": "npm run build:deps && npm run clean-compiled && tsc",
|
|
19
|
+
"prepublishOnly": "npm run build",
|
|
20
|
+
"lint": "oxlint",
|
|
21
|
+
"format": "oxfmt \"index.ts\" \"debug.ts\" \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
22
|
+
"format:check": "oxfmt --check \"index.ts\" \"debug.ts\" \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
23
|
+
"test": "npm run build && node --experimental-test-module-mocks --test --test-timeout=15000 $(find test -name '*.spec.js')",
|
|
24
|
+
"test-coverage": "npm run build && node --experimental-test-module-mocks --enable-source-maps --test --experimental-test-coverage --test-timeout=15000 $(find test -name '*.spec.js')",
|
|
25
|
+
"test-lcov": "npm run build && mkdir -p coverage && node --experimental-test-module-mocks --enable-source-maps --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test-timeout=15000 $(find test -name '*.spec.js'); node scripts/strip-comment-coverage.mjs coverage/lcov.info",
|
|
26
|
+
"test-coverage-html": "npm run test-lcov; genhtml coverage/lcov.info --output-directory coverage/html --ignore-errors inconsistent,corrupt,format,mismatch && echo \"Coverage report: file://$(pwd)/coverage/html/index.html\"",
|
|
27
|
+
"test-dev": "npm run test && npm run clean-js && npm run clean-typedefs && npm run clean-maps",
|
|
20
28
|
"clean-typedefs": "find . -name '*.d.ts' -not -wholename '*node_modules*' -not -wholename '*generator*' -type f -delete",
|
|
21
29
|
"clean-maps": "find . -name '*.js.map' -not -wholename '*node_modules*' -not -wholename '*generator*' -type f -delete",
|
|
22
30
|
"clean-js": "find . -name '*.js' -not -wholename '*node_modules*' -not -wholename '*generator*' -type f -delete",
|
|
23
31
|
"clean-tests": "rm -rf .nyc_output coverage",
|
|
24
|
-
"clean-doc": "rm -rf docs",
|
|
25
32
|
"clean-benchmark": "rm -rf benchmark-result",
|
|
26
|
-
"clean": "npm run clean-tests && npm run clean-typedefs && npm run clean-maps && npm run clean-js && npm run clean-
|
|
27
|
-
"doc": "rm -rf docs && typedoc --excludePrivate --excludeExternals --hideGenerator --exclude \"**/+(debug|test|node_modules|docs|coverage|benchmark|.nyc_output)/**/*\" --out ./docs . && /usr/bin/env node -e \"import('open').then(open => open.default('file://`pwd`/docs/index.html', { wait: false }));\""
|
|
33
|
+
"clean": "npm run clean-tests && npm run clean-typedefs && npm run clean-maps && npm run clean-js && npm run clean-benchmark"
|
|
28
34
|
},
|
|
29
35
|
"repository": {
|
|
30
36
|
"type": "git",
|
|
@@ -37,62 +43,21 @@
|
|
|
37
43
|
"author": "imqueue.com <support@imqueue.com> (https://imqueue.com)",
|
|
38
44
|
"license": "GPL-3.0-only",
|
|
39
45
|
"dependencies": {
|
|
40
|
-
"@imqueue/core": "^
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"farmhash": "^5.0.1",
|
|
44
|
-
"node-machine-id": "^1.1.12",
|
|
45
|
-
"reflect-metadata": "^0.2.2",
|
|
46
|
-
"typescript": "^5.9.3"
|
|
46
|
+
"@imqueue/core": "^3.1.0",
|
|
47
|
+
"acorn": "^8.17.0",
|
|
48
|
+
"typescript": "^7.0.2"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
|
-
"@types/
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"@types/sinon": "^17.0.4",
|
|
53
|
-
"chai": "^6.0.1",
|
|
54
|
-
"coveralls-next": "^5.0.0",
|
|
55
|
-
"minimist": "^1.2.8",
|
|
56
|
-
"mocha": "^11.7.2",
|
|
57
|
-
"mocha-lcov-reporter": "^1.3.0",
|
|
58
|
-
"mock-require": "^3.0.3",
|
|
59
|
-
"nyc": "^17.1.0",
|
|
60
|
-
"open": "^10.1.2",
|
|
61
|
-
"sinon": "^21.0.0",
|
|
62
|
-
"source-map-support": "^0.5.21",
|
|
63
|
-
"ts-node": "^10.9.2",
|
|
64
|
-
"typedoc": "^0.28.12"
|
|
51
|
+
"@types/node": "^24.9.1",
|
|
52
|
+
"oxfmt": "0.57.0",
|
|
53
|
+
"oxlint": "1.72.0"
|
|
65
54
|
},
|
|
66
55
|
"main": "index.js",
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"source-map-support/register"
|
|
74
|
-
],
|
|
75
|
-
"recursive": true,
|
|
76
|
-
"bail": true,
|
|
77
|
-
"full-trace": true
|
|
78
|
-
},
|
|
79
|
-
"nyc": {
|
|
80
|
-
"check-coverage": false,
|
|
81
|
-
"extension": [
|
|
82
|
-
".ts"
|
|
83
|
-
],
|
|
84
|
-
"exclude": [
|
|
85
|
-
"**/*.d.ts",
|
|
86
|
-
"**/test/**"
|
|
87
|
-
],
|
|
88
|
-
"require": [
|
|
89
|
-
"ts-node/register"
|
|
90
|
-
],
|
|
91
|
-
"reporter": [
|
|
92
|
-
"html",
|
|
93
|
-
"text",
|
|
94
|
-
"text-summary",
|
|
95
|
-
"lcovonly"
|
|
96
|
-
]
|
|
56
|
+
"types": "index.d.ts",
|
|
57
|
+
"exports": {
|
|
58
|
+
".": {
|
|
59
|
+
"types": "./index.d.ts",
|
|
60
|
+
"default": "./index.js"
|
|
61
|
+
}
|
|
97
62
|
}
|
|
98
63
|
}
|
package/src/IMQCache.d.ts
CHANGED
|
@@ -31,31 +31,32 @@ export declare class IMQCache {
|
|
|
31
31
|
[name: string]: ICache;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
* Registers given cache adapter
|
|
34
|
+
* Registers the given cache adapter.
|
|
35
35
|
*
|
|
36
|
-
* @param {
|
|
37
|
-
*
|
|
36
|
+
* @param {ICacheAdapter | string} adapter - adapter name, class or
|
|
37
|
+
* instance
|
|
38
|
+
* @param {any} [options] - adapter-specific options
|
|
38
39
|
* @returns {IMQCache}
|
|
39
40
|
*/
|
|
40
41
|
static register(adapter: ICacheAdapter | string, options?: any): typeof IMQCache;
|
|
41
42
|
/**
|
|
42
|
-
* Overrides existing adapter options with the given
|
|
43
|
+
* Overrides existing adapter options with the given ones.
|
|
43
44
|
*
|
|
44
|
-
* @param {
|
|
45
|
-
* @param {any} options - adapter
|
|
45
|
+
* @param {ICacheAdapter | string} adapter - adapter to apply options to
|
|
46
|
+
* @param {any} options - adapter-specific options
|
|
46
47
|
* @returns {IMQCache}
|
|
47
48
|
*/
|
|
48
49
|
static apply(adapter: ICacheAdapter | string, options: any): typeof IMQCache;
|
|
49
50
|
/**
|
|
50
|
-
* Initializes all registered cache adapters
|
|
51
|
+
* Initializes all registered cache adapters.
|
|
51
52
|
*
|
|
52
53
|
* @returns {Promise<any>}
|
|
53
54
|
*/
|
|
54
55
|
static init(): Promise<any>;
|
|
55
56
|
/**
|
|
56
|
-
* Returns registered cache adapter by its given name or class
|
|
57
|
+
* Returns a registered cache adapter by its given name or class.
|
|
57
58
|
*
|
|
58
|
-
* @param {
|
|
59
|
+
* @param {ICacheAdapter} adapter - adapter name, class or instance
|
|
59
60
|
* @returns {ICache} - adapter instance
|
|
60
61
|
*/
|
|
61
62
|
static get(adapter: ICacheAdapter): ICache;
|
package/src/IMQCache.js
CHANGED
|
@@ -5,23 +5,24 @@ exports.IMQCache = void 0;
|
|
|
5
5
|
* Generic cache registry
|
|
6
6
|
*/
|
|
7
7
|
class IMQCache {
|
|
8
|
+
static options = {};
|
|
9
|
+
static adapters = {};
|
|
8
10
|
/**
|
|
9
|
-
* Registers given cache adapter
|
|
11
|
+
* Registers the given cache adapter.
|
|
10
12
|
*
|
|
11
|
-
* @param {
|
|
12
|
-
*
|
|
13
|
+
* @param {ICacheAdapter | string} adapter - adapter name, class or
|
|
14
|
+
* instance
|
|
15
|
+
* @param {any} [options] - adapter-specific options
|
|
13
16
|
* @returns {IMQCache}
|
|
14
17
|
*/
|
|
15
18
|
static register(adapter, options) {
|
|
16
19
|
const self = IMQCache;
|
|
17
20
|
if (typeof adapter === 'string') {
|
|
18
|
-
// istanbul ignore else
|
|
19
21
|
if (!self.adapters[adapter]) {
|
|
20
|
-
self.adapters[adapter] = new (require(`${__dirname}/cache/${adapter}.js`)[adapter])();
|
|
22
|
+
self.adapters[adapter] = (new (require(`${__dirname}/cache/${adapter}.js`)[adapter])());
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
else {
|
|
24
|
-
// istanbul ignore else
|
|
25
26
|
if (!self.adapters[adapter.name]) {
|
|
26
27
|
if (typeof adapter === 'function') {
|
|
27
28
|
self.adapters[adapter.name] =
|
|
@@ -37,10 +38,10 @@ class IMQCache {
|
|
|
37
38
|
return self;
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
|
-
* Overrides existing adapter options with the given
|
|
41
|
+
* Overrides existing adapter options with the given ones.
|
|
41
42
|
*
|
|
42
|
-
* @param {
|
|
43
|
-
* @param {any} options - adapter
|
|
43
|
+
* @param {ICacheAdapter | string} adapter - adapter to apply options to
|
|
44
|
+
* @param {any} options - adapter-specific options
|
|
44
45
|
* @returns {IMQCache}
|
|
45
46
|
*/
|
|
46
47
|
static apply(adapter, options) {
|
|
@@ -48,15 +49,13 @@ class IMQCache {
|
|
|
48
49
|
if (!options) {
|
|
49
50
|
return self;
|
|
50
51
|
}
|
|
51
|
-
const name = typeof adapter === 'string'
|
|
52
|
-
? adapter
|
|
53
|
-
: adapter.name;
|
|
52
|
+
const name = typeof adapter === 'string' ? adapter : adapter.name;
|
|
54
53
|
let opts = self.options[name] || {};
|
|
55
|
-
self.options[name] =
|
|
54
|
+
self.options[name] = { ...opts, ...options };
|
|
56
55
|
return self;
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
|
-
* Initializes all registered cache adapters
|
|
58
|
+
* Initializes all registered cache adapters.
|
|
60
59
|
*
|
|
61
60
|
* @returns {Promise<any>}
|
|
62
61
|
*/
|
|
@@ -64,7 +63,6 @@ class IMQCache {
|
|
|
64
63
|
const self = IMQCache;
|
|
65
64
|
const promises = [];
|
|
66
65
|
for (let adapter of Object.keys(self.adapters)) {
|
|
67
|
-
// istanbul ignore else
|
|
68
66
|
if (!self.adapters[adapter].ready) {
|
|
69
67
|
promises.push(self.adapters[adapter].init(self.options[adapter]));
|
|
70
68
|
}
|
|
@@ -73,18 +71,14 @@ class IMQCache {
|
|
|
73
71
|
return self;
|
|
74
72
|
}
|
|
75
73
|
/**
|
|
76
|
-
* Returns registered cache adapter by its given name or class
|
|
74
|
+
* Returns a registered cache adapter by its given name or class.
|
|
77
75
|
*
|
|
78
|
-
* @param {
|
|
76
|
+
* @param {ICacheAdapter} adapter - adapter name, class or instance
|
|
79
77
|
* @returns {ICache} - adapter instance
|
|
80
78
|
*/
|
|
81
79
|
static get(adapter) {
|
|
82
|
-
return IMQCache.adapters[typeof adapter === 'string'
|
|
83
|
-
? adapter
|
|
84
|
-
: adapter.name];
|
|
80
|
+
return IMQCache.adapters[typeof adapter === 'string' ? adapter : adapter.name];
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
83
|
exports.IMQCache = IMQCache;
|
|
88
|
-
IMQCache.options = {};
|
|
89
|
-
IMQCache.adapters = {};
|
|
90
84
|
//# sourceMappingURL=IMQCache.js.map
|
package/src/IMQClient.d.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { JsonObject } from '@imqueue/core';
|
|
25
25
|
import { IMQClientOptions, IMQRPCResponse, IMQRPCRequest, IMQDelay, Description } from '.';
|
|
26
|
-
import { EventEmitter } from 'events';
|
|
26
|
+
import { EventEmitter } from 'node:events';
|
|
27
27
|
/**
|
|
28
28
|
* Class IMQClient - base abstract class for service clients.
|
|
29
29
|
*/
|
|
@@ -37,13 +37,16 @@ export declare abstract class IMQClient extends EventEmitter {
|
|
|
37
37
|
private readonly baseName;
|
|
38
38
|
private readonly imq;
|
|
39
39
|
private readonly subscriptionImq;
|
|
40
|
-
private static singleImq
|
|
40
|
+
private static singleImq?;
|
|
41
|
+
private static singleImqRefs;
|
|
42
|
+
private static maxListenersBumped;
|
|
43
|
+
private destroyed;
|
|
44
|
+
private readonly signalHandlers;
|
|
41
45
|
private readonly logger;
|
|
42
46
|
private resolvers;
|
|
43
47
|
/**
|
|
44
48
|
* Class constructor
|
|
45
49
|
*
|
|
46
|
-
* @constructor
|
|
47
50
|
* @param {Partial<IMQClientOptions>} options
|
|
48
51
|
* @param {string} serviceName
|
|
49
52
|
* @param {string} name
|
|
@@ -54,7 +57,6 @@ export declare abstract class IMQClient extends EventEmitter {
|
|
|
54
57
|
/**
|
|
55
58
|
* Sends call to remote service method
|
|
56
59
|
*
|
|
57
|
-
* @access protected
|
|
58
60
|
* @param {...any[]} args
|
|
59
61
|
* @template T
|
|
60
62
|
* @returns {Promise<T>}
|
|
@@ -102,10 +104,11 @@ export declare abstract class IMQClient extends EventEmitter {
|
|
|
102
104
|
/**
|
|
103
105
|
* Returns service description metadata.
|
|
104
106
|
*
|
|
105
|
-
* @param {IMQDelay} delay
|
|
107
|
+
* @param {IMQDelay} [_delay] - optional delivery delay; forwarded to the
|
|
108
|
+
* service through `arguments` by the `@remote` decorator
|
|
106
109
|
* @returns {Promise<Description>}
|
|
107
110
|
*/
|
|
108
|
-
describe(
|
|
111
|
+
describe(_delay?: IMQDelay): Promise<Description>;
|
|
109
112
|
/**
|
|
110
113
|
* Creates client for a service with the given name
|
|
111
114
|
*
|
|
@@ -116,20 +119,22 @@ export declare abstract class IMQClient extends EventEmitter {
|
|
|
116
119
|
static create(name: string, options?: Partial<IMQClientOptions>): Promise<any>;
|
|
117
120
|
}
|
|
118
121
|
/**
|
|
119
|
-
* Builds
|
|
122
|
+
* Builds a call resolver that resolves the pending promise and then runs the
|
|
123
|
+
* optional after-call hook.
|
|
120
124
|
*
|
|
121
|
-
* @param {(
|
|
122
|
-
* @param {IMQRPCRequest} req
|
|
123
|
-
* @param {IMQClient} client -
|
|
124
|
-
* @return {(data: any, res: IMQRPCResponse) => void} - hook-
|
|
125
|
+
* @param {(data: any) => void} resolve - the underlying promise resolver
|
|
126
|
+
* @param {IMQRPCRequest} req - the originating request message
|
|
127
|
+
* @param {IMQClient} client - the client the call belongs to
|
|
128
|
+
* @return {(data: any, res: IMQRPCResponse) => void} - a hook-aware resolver
|
|
125
129
|
*/
|
|
126
130
|
export declare function imqCallResolver(resolve: (data: any) => void, req: IMQRPCRequest, client: IMQClient): (data: any, res: IMQRPCResponse) => void;
|
|
127
131
|
/**
|
|
128
|
-
* Builds
|
|
132
|
+
* Builds a call rejector that rejects the pending promise and then runs the
|
|
133
|
+
* optional after-call hook.
|
|
129
134
|
*
|
|
130
|
-
* @param {(err: any) => void} reject -
|
|
131
|
-
* @param {IMQRPCRequest} req -
|
|
132
|
-
* @param {IMQClient} client -
|
|
133
|
-
* @return {(err: any) => void} - hook-
|
|
135
|
+
* @param {(err: any) => void} reject - the underlying promise rejector
|
|
136
|
+
* @param {IMQRPCRequest} req - the originating request message
|
|
137
|
+
* @param {IMQClient} client - the client the call belongs to
|
|
138
|
+
* @return {(err: any, res?: IMQRPCResponse) => void} - a hook-aware rejector
|
|
134
139
|
*/
|
|
135
140
|
export declare function imqCallRejector(reject: (err: any) => void, req: IMQRPCRequest, client: IMQClient): (err: any, res?: IMQRPCResponse) => void;
|