redis-abstraction 2.0.12 → 2.0.13

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.
@@ -13,8 +13,9 @@ export interface IRedisClientPool {
13
13
  */
14
14
  release(token: string): Promise<void>;
15
15
  /**
16
- * Signals a dispose method to the pool stating no more clients will be needed, donot call any methods post calling shutdown.
16
+ * Signals a dispose method to the pool stating no more clients will be needed, do not call any methods post calling shutdown.
17
17
  */
18
+ [Symbol.asyncDispose](): Promise<void>;
18
19
  shutdown(): Promise<void>;
19
20
  /**
20
21
  * Executes a single command on acquired connection.
@@ -32,4 +32,5 @@ export declare class IORedisClientPool<redisConnectionType extends TIORedisCommo
32
32
  };
33
33
  private MD5Hash;
34
34
  static IORedisClientClusterFactory(connectionDetails: string[], redisClass: new (...args: any) => TIORedisCommonCommands, clusterClass: new (...args: any) => TIORedisCommonCommands, parseURLFunction: (url: string) => Record<string, any>, instanceInjection?: <T>(c: new (...args: any) => T, args: any[]) => T): TIORedisCommonCommands;
35
+ [Symbol.asyncDispose](): Promise<void>;
35
36
  }
@@ -149,5 +149,8 @@ class IORedisClientPool {
149
149
  return instanceInjection(redisClass, [connectionDetails[0]]);
150
150
  }
151
151
  }
152
+ [Symbol.asyncDispose]() {
153
+ return this.shutdown();
154
+ }
152
155
  }
153
156
  exports.IORedisClientPool = IORedisClientPool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redis-abstraction",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "description": "A Redis client pool with abstraction to different Redis libraries.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,4 +20,5 @@ export declare class RedisClientPool<redisConnectionType extends TRedisCommonCom
20
20
  pipeline(token: string, commands: string[][], transaction: boolean): Promise<any>;
21
21
  script(token: string, filePath: string, keys: string[], args: string[]): Promise<any>;
22
22
  generateUniqueToken(prefix: string): string;
23
+ [Symbol.asyncDispose](): Promise<void>;
23
24
  }
@@ -111,5 +111,8 @@ class RedisClientPool {
111
111
  generateUniqueToken(prefix) {
112
112
  return `${prefix}-${this.nodeCryptoModule.randomUUID()}`;
113
113
  }
114
+ [Symbol.asyncDispose]() {
115
+ return this.shutdown();
116
+ }
114
117
  }
115
118
  exports.RedisClientPool = RedisClientPool;