@imqueue/rpc 1.17.1 → 2.0.2
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 +3 -2
- package/index.d.ts +16 -12
- package/index.js +16 -12
- package/package.json +15 -15
- package/src/IMQCache.d.ts +17 -11
- package/src/IMQClient.d.ts +26 -13
- package/src/IMQClient.js +66 -31
- package/src/IMQDelay.d.ts +17 -11
- package/src/IMQDelay.js +17 -11
- package/src/IMQLock.d.ts +17 -11
- package/src/IMQLock.js +0 -17
- package/src/IMQMetadata.d.ts +17 -11
- package/src/IMQRPCDescription.d.ts +17 -11
- package/src/IMQRPCDescription.js +0 -17
- package/src/IMQRPCError.d.ts +17 -11
- package/src/IMQRPCOptions.d.ts +18 -11
- package/src/IMQRPCOptions.js +17 -11
- package/src/IMQRPCRequest.d.ts +17 -11
- package/src/IMQRPCResponse.d.ts +17 -11
- package/src/IMQService.d.ts +18 -12
- package/src/IMQService.js +18 -12
- package/src/cache/ICache.d.ts +17 -11
- package/src/cache/RedisCache.d.ts +24 -17
- package/src/cache/RedisCache.js +11 -10
- package/src/cache/index.d.ts +19 -11
- package/src/cache/index.js +19 -11
- package/src/decorators/cache.d.ts +17 -11
- package/src/decorators/cache.js +17 -11
- package/src/decorators/expose.d.ts +17 -11
- package/src/decorators/expose.js +17 -11
- package/src/decorators/index.d.ts +19 -11
- package/src/decorators/index.js +19 -11
- package/src/decorators/indexed.js +19 -13
- package/src/decorators/lock.js +17 -11
- package/src/decorators/logged.d.ts +17 -11
- package/src/decorators/property.js +19 -13
- package/src/decorators/remote.d.ts +17 -11
- package/src/decorators/remote.js +17 -11
- package/src/helpers/fs.js +17 -11
- package/src/helpers/index.d.ts +18 -11
- package/src/helpers/index.js +18 -11
- package/src/helpers/os-uuid.js +17 -11
- package/src/helpers/pid.js +17 -11
- package/src/helpers/signature.js +17 -11
- package/src/index.d.ts +17 -11
- package/src/index.js +17 -11
package/src/IMQRPCDescription.js
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* IMQRPCDescription implementation
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2018, imqueue.com <support@imqueue.com>
|
|
6
|
-
*
|
|
7
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
9
|
-
* copyright notice and this permission notice appear in all copies.
|
|
10
|
-
*
|
|
11
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
*/
|
|
19
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
3
|
exports.IMQRPCDescription = void 0;
|
|
21
4
|
class IMQRPCDescription {
|
package/src/IMQRPCError.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* IMQ-RPC Interfaces: IMQRPCError
|
|
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 { JsonObject } from '@imqueue/core';
|
|
19
25
|
export declare const BEFORE_HOOK_ERROR = "Before call hook error:";
|
package/src/IMQRPCOptions.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* IMQ-RPC Interfaces: IMQServiceOptions
|
|
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 { IMQOptions } from '@imqueue/core';
|
|
19
25
|
import { IMQRPCRequest } from './IMQRPCRequest';
|
|
@@ -39,6 +45,7 @@ export interface IMQClientOptions extends IMQOptions {
|
|
|
39
45
|
write: boolean;
|
|
40
46
|
beforeCall?: IMQBeforeCall<IMQClient>;
|
|
41
47
|
afterCall?: IMQAfterCall<IMQClient>;
|
|
48
|
+
singleQueue?: boolean;
|
|
42
49
|
}
|
|
43
50
|
/**
|
|
44
51
|
* Default service options
|
package/src/IMQRPCOptions.js
CHANGED
|
@@ -4,19 +4,25 @@ exports.DEFAULT_IMQ_CLIENT_OPTIONS = exports.DEFAULT_IMQ_SERVICE_OPTIONS = void
|
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC Interfaces: IMQServiceOptions
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* I'm Queue Software Project
|
|
8
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* This program is free software: you can redistribute it and/or modify
|
|
11
|
+
* it under the terms of the GNU General Public License as published by
|
|
12
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
13
|
+
* (at your option) any later version.
|
|
12
14
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* This program is distributed in the hope that it will be useful,
|
|
16
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
* GNU General Public License for more details.
|
|
19
|
+
*
|
|
20
|
+
* You should have received a copy of the GNU General Public License
|
|
21
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
22
|
+
*
|
|
23
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
24
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
25
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
20
26
|
*/
|
|
21
27
|
const core_1 = require("@imqueue/core");
|
|
22
28
|
/**
|
package/src/IMQRPCRequest.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* IMQ-RPC Interfaces: IMQRPCRequest
|
|
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 { JsonObject } from '@imqueue/core';
|
|
19
25
|
import { IMQMetadata } from './IMQMetadata';
|
package/src/IMQRPCResponse.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* IMQ-RPC Interfaces: IMQRPCResponse
|
|
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 { JsonObject } from '@imqueue/core';
|
|
19
25
|
import { IMQRPCError, IMQRPCRequest } from '.';
|
package/src/IMQService.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* IMQService implementation
|
|
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 { JsonObject, ILogger, IMessageQueue } from '@imqueue/core';
|
|
19
25
|
import { TypesDescription, IMQRPCRequest, IMQRPCResponse, IMQServiceOptions, ICache, MethodsCollectionDescription } from '.';
|
|
@@ -56,7 +62,7 @@ export declare abstract class IMQService {
|
|
|
56
62
|
* Initializes this instance of service and starts handling request
|
|
57
63
|
* messages.
|
|
58
64
|
*
|
|
59
|
-
* @return {Promise<IMessageQueue>}
|
|
65
|
+
* @return {Promise<IMessageQueue | undefined>}
|
|
60
66
|
*/
|
|
61
67
|
start(): Promise<IMessageQueue | undefined>;
|
|
62
68
|
/**
|
package/src/IMQService.js
CHANGED
|
@@ -14,19 +14,25 @@ exports.send = send;
|
|
|
14
14
|
/*!
|
|
15
15
|
* IMQService implementation
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* I'm Queue Software Project
|
|
18
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* This program is free software: you can redistribute it and/or modify
|
|
21
|
+
* it under the terms of the GNU General Public License as published by
|
|
22
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
23
|
+
* (at your option) any later version.
|
|
22
24
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
25
|
+
* This program is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
28
|
+
* GNU General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU General Public License
|
|
31
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
32
|
+
*
|
|
33
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
34
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
35
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
30
36
|
*/
|
|
31
37
|
const core_1 = require("@imqueue/core");
|
|
32
38
|
const _1 = require(".");
|
|
@@ -153,7 +159,7 @@ class IMQService {
|
|
|
153
159
|
* Initializes this instance of service and starts handling request
|
|
154
160
|
* messages.
|
|
155
161
|
*
|
|
156
|
-
* @return {Promise<IMessageQueue>}
|
|
162
|
+
* @return {Promise<IMessageQueue | undefined>}
|
|
157
163
|
*/
|
|
158
164
|
async start() {
|
|
159
165
|
if (!this.options.multiProcess) {
|
package/src/cache/ICache.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* IMQCache interfaces
|
|
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
|
export interface ICacheConstructor {
|
|
19
25
|
new (name?: string): ICache;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* RedisCache adapter implementation
|
|
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 { ICache } from '.';
|
|
19
25
|
import { ILogger, IRedisClient, IMQOptions } from '@imqueue/core';
|
|
@@ -24,18 +30,19 @@ export declare const DEFAULT_REDIS_CACHE_OPTIONS: {
|
|
|
24
30
|
prefix: string;
|
|
25
31
|
cleanup: boolean;
|
|
26
32
|
cleanupFilter: string;
|
|
27
|
-
host?: string;
|
|
28
|
-
port?: number;
|
|
29
33
|
vendor?: string;
|
|
30
34
|
logger?: ILogger;
|
|
31
35
|
watcherCheckDelay?: number;
|
|
32
36
|
useGzip?: boolean;
|
|
33
37
|
safeDelivery?: boolean;
|
|
34
38
|
safeDeliveryTtl?: number;
|
|
35
|
-
cluster?:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
cluster?: import("@imqueue/core").IMessageQueueConnection[];
|
|
40
|
+
clusterManagers?: import("@imqueue/core/src/ClusterManager").ClusterManager[];
|
|
41
|
+
id?: string | undefined;
|
|
42
|
+
host?: string | undefined;
|
|
43
|
+
port?: number | undefined;
|
|
44
|
+
username?: string | undefined;
|
|
45
|
+
password?: string | undefined;
|
|
39
46
|
};
|
|
40
47
|
export declare const REDIS_CLIENT_INIT_ERROR = "Redis client is not initialized!";
|
|
41
48
|
/**
|
package/src/cache/RedisCache.js
CHANGED
|
@@ -33,15 +33,16 @@ class RedisCache {
|
|
|
33
33
|
return this;
|
|
34
34
|
}
|
|
35
35
|
return new Promise((resolve, reject) => {
|
|
36
|
-
|
|
36
|
+
const connectionName = `${this.options.prefix}:${this.name}:pid:${process.pid}:host:${os.hostname()}`;
|
|
37
|
+
RedisCache.redis = new core_1.Redis({
|
|
38
|
+
port: Number(this.options.port),
|
|
39
|
+
host: String(this.options.host),
|
|
40
|
+
username: this.options.username,
|
|
41
|
+
password: this.options.password,
|
|
42
|
+
connectionName,
|
|
43
|
+
});
|
|
37
44
|
RedisCache.redis.on('ready', async () => {
|
|
38
45
|
this.logger.info('%s: redis cache connected, host %s:%s, pid %s', this.name, this.options.host, this.options.port, process.pid);
|
|
39
|
-
try {
|
|
40
|
-
await RedisCache.redis.client('setname', `${this.options.prefix}:${this.name}:pid:${process.pid}:host:${os.hostname()}`);
|
|
41
|
-
}
|
|
42
|
-
catch (err) {
|
|
43
|
-
this.logger.warn('Redis client command error:', err);
|
|
44
|
-
}
|
|
45
46
|
this.ready = true;
|
|
46
47
|
resolve(this);
|
|
47
48
|
});
|
|
@@ -118,7 +119,7 @@ class RedisCache {
|
|
|
118
119
|
if (!RedisCache.redis) {
|
|
119
120
|
throw new TypeError(exports.REDIS_CLIENT_INIT_ERROR);
|
|
120
121
|
}
|
|
121
|
-
return await RedisCache.redis.del(this.key(key));
|
|
122
|
+
return !!await RedisCache.redis.del(this.key(key));
|
|
122
123
|
}
|
|
123
124
|
/**
|
|
124
125
|
* Purges all keys from cache by a given wildcard mask
|
|
@@ -150,8 +151,8 @@ class RedisCache {
|
|
|
150
151
|
// istanbul ignore else
|
|
151
152
|
if (RedisCache.redis) {
|
|
152
153
|
RedisCache.redis.removeAllListeners();
|
|
153
|
-
RedisCache.redis.
|
|
154
|
-
RedisCache.redis.
|
|
154
|
+
RedisCache.redis.disconnect(false);
|
|
155
|
+
RedisCache.redis.quit();
|
|
155
156
|
delete RedisCache.redis;
|
|
156
157
|
}
|
|
157
158
|
}
|
package/src/cache/index.d.ts
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright (
|
|
2
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* copyright notice and this permission notice appear in all copies.
|
|
4
|
+
* I'm Queue Software Project
|
|
5
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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.
|
|
15
23
|
*/
|
|
16
24
|
export * from './ICache';
|
|
17
25
|
export * from './RedisCache';
|
package/src/cache/index.js
CHANGED
|
@@ -15,19 +15,27 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/*!
|
|
18
|
-
* Copyright (
|
|
18
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* copyright notice and this permission notice appear in all copies.
|
|
20
|
+
* I'm Queue Software Project
|
|
21
|
+
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
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.
|
|
27
|
+
*
|
|
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.
|
|
31
39
|
*/
|
|
32
40
|
__exportStar(require("./ICache"), exports);
|
|
33
41
|
__exportStar(require("./RedisCache"), exports);
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* IMQ-RPC Decorators: cache
|
|
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 { ICache, ICacheConstructor } from '..';
|
|
19
25
|
export interface CacheDecoratorOptions {
|