@imqueue/rpc 1.17.0 → 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.
Files changed (47) hide show
  1. package/LICENSE +585 -13
  2. package/README.md +2 -1
  3. package/index.d.ts +16 -12
  4. package/index.js +16 -12
  5. package/package.json +15 -15
  6. package/src/IMQCache.d.ts +17 -11
  7. package/src/IMQClient.d.ts +26 -13
  8. package/src/IMQClient.js +49 -20
  9. package/src/IMQDelay.d.ts +17 -11
  10. package/src/IMQDelay.js +17 -11
  11. package/src/IMQLock.d.ts +17 -11
  12. package/src/IMQLock.js +8 -18
  13. package/src/IMQMetadata.d.ts +17 -11
  14. package/src/IMQRPCDescription.d.ts +17 -11
  15. package/src/IMQRPCDescription.js +0 -17
  16. package/src/IMQRPCError.d.ts +17 -11
  17. package/src/IMQRPCOptions.d.ts +18 -11
  18. package/src/IMQRPCOptions.js +17 -11
  19. package/src/IMQRPCRequest.d.ts +17 -11
  20. package/src/IMQRPCResponse.d.ts +17 -11
  21. package/src/IMQService.d.ts +18 -12
  22. package/src/IMQService.js +18 -12
  23. package/src/cache/ICache.d.ts +17 -11
  24. package/src/cache/RedisCache.d.ts +24 -17
  25. package/src/cache/RedisCache.js +11 -10
  26. package/src/cache/index.d.ts +19 -11
  27. package/src/cache/index.js +19 -11
  28. package/src/decorators/cache.d.ts +17 -11
  29. package/src/decorators/cache.js +17 -11
  30. package/src/decorators/expose.d.ts +17 -11
  31. package/src/decorators/expose.js +17 -11
  32. package/src/decorators/index.d.ts +19 -11
  33. package/src/decorators/index.js +19 -11
  34. package/src/decorators/indexed.js +19 -13
  35. package/src/decorators/lock.js +17 -11
  36. package/src/decorators/logged.d.ts +17 -11
  37. package/src/decorators/property.js +19 -13
  38. package/src/decorators/remote.d.ts +17 -11
  39. package/src/decorators/remote.js +17 -11
  40. package/src/helpers/fs.js +17 -11
  41. package/src/helpers/index.d.ts +18 -11
  42. package/src/helpers/index.js +18 -11
  43. package/src/helpers/os-uuid.js +17 -11
  44. package/src/helpers/pid.js +17 -11
  45. package/src/helpers/signature.js +17 -11
  46. package/src/index.d.ts +17 -11
  47. package/src/index.js +17 -11
@@ -1,19 +1,25 @@
1
1
  /*!
2
2
  * IMQ-RPC Interfaces: IMQRPCError
3
3
  *
4
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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:";
@@ -1,19 +1,25 @@
1
1
  /*!
2
2
  * IMQ-RPC Interfaces: IMQServiceOptions
3
3
  *
4
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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
@@ -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
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
7
+ * I'm Queue Software Project
8
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
8
9
  *
9
- * Permission to use, copy, modify, and/or distribute this software for any
10
- * purpose with or without fee is hereby granted, provided that the above
11
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- * PERFORMANCE OF THIS SOFTWARE.
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
  /**
@@ -1,19 +1,25 @@
1
1
  /*!
2
2
  * IMQ-RPC Interfaces: IMQRPCRequest
3
3
  *
4
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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';
@@ -1,19 +1,25 @@
1
1
  /*!
2
2
  * IMQ-RPC Interfaces: IMQRPCResponse
3
3
  *
4
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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 '.';
@@ -1,19 +1,25 @@
1
1
  /*!
2
2
  * IMQService implementation
3
3
  *
4
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
17
+ * I'm Queue Software Project
18
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
18
19
  *
19
- * Permission to use, copy, modify, and/or distribute this software for any
20
- * purpose with or without fee is hereby granted, provided that the above
21
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
24
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
26
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
27
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
28
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
29
- * PERFORMANCE OF THIS SOFTWARE.
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) {
@@ -1,19 +1,25 @@
1
1
  /*!
2
2
  * IMQCache interfaces
3
3
  *
4
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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
- host: string;
37
- port: number;
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
  /**
@@ -33,15 +33,16 @@ class RedisCache {
33
33
  return this;
34
34
  }
35
35
  return new Promise((resolve, reject) => {
36
- RedisCache.redis = core_1.redis.createClient(Number(this.options.port), String(this.options.host));
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.end(false);
154
- RedisCache.redis.unref();
154
+ RedisCache.redis.disconnect(false);
155
+ RedisCache.redis.quit();
155
156
  delete RedisCache.redis;
156
157
  }
157
158
  }
@@ -1,17 +1,25 @@
1
1
  /*!
2
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
2
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
3
3
  *
4
- * Permission to use, copy, modify, and/or distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- * PERFORMANCE OF THIS SOFTWARE.
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';
@@ -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 (c) 2018, imqueue.com <support@imqueue.com>
18
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
19
19
  *
20
- * Permission to use, copy, modify, and/or distribute this software for any
21
- * purpose with or without fee is hereby granted, provided that the above
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
26
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
27
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
28
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
29
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30
- * PERFORMANCE OF THIS SOFTWARE.
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
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
5
6
  *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- * PERFORMANCE OF THIS SOFTWARE.
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 {
@@ -4,19 +4,25 @@ exports.cache = void 0;
4
4
  /*!
5
5
  * IMQ-RPC Decorators: cache
6
6
  *
7
- * Copyright (c) 2018, imqueue.com <support@imqueue.com>
7
+ * I'm Queue Software Project
8
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
8
9
  *
9
- * Permission to use, copy, modify, and/or distribute this software for any
10
- * purpose with or without fee is hereby granted, provided that the above
11
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- * PERFORMANCE OF THIS SOFTWARE.
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 __1 = require("..");
22
28
  // codebeat:disable[BLOCK_NESTING]