@stackone/transport 2.9.0 → 2.11.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/dist/index.cjs +31 -35
- package/dist/index.d.cts +5 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +31 -35
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -150,6 +150,7 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
150
150
|
args: string[];
|
|
151
151
|
}): Promise<T | null>;
|
|
152
152
|
loadScript?(script: string): Promise<string | null>;
|
|
153
|
+
scriptExists?(shas: string[]): Promise<boolean[]>;
|
|
153
154
|
increment?(key: string, cacheTTL: number): Promise<number | null>;
|
|
154
155
|
decrement?(key: string, cacheTTL: number): Promise<number | null>;
|
|
155
156
|
subscribe?<T extends boolean = false>(pattern: string, listener: PubSubListener<T>): Promise<boolean>;
|
|
@@ -207,6 +208,7 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
207
208
|
args: string[];
|
|
208
209
|
}): Promise<T | null>;
|
|
209
210
|
loadScript(script: string): Promise<string | null>;
|
|
211
|
+
scriptExists(shas: string[]): Promise<boolean[]>;
|
|
210
212
|
increment(key: string, cacheTTL: number): Promise<number | null>;
|
|
211
213
|
decrement(key: string, cacheTTL: number): Promise<number | null>;
|
|
212
214
|
subscribe<T extends boolean>(pattern: string, listener: PubSubListener<T>): Promise<boolean>;
|
|
@@ -249,6 +251,8 @@ declare abstract class ScriptManager<T extends string, S extends ScriptManager<T
|
|
|
249
251
|
protected logger: ILogger;
|
|
250
252
|
protected additionalArgs: unknown[];
|
|
251
253
|
protected isInitialConnection: boolean;
|
|
254
|
+
protected reloadInProgress: Promise<void> | null;
|
|
255
|
+
protected lastReloadTime: number;
|
|
252
256
|
protected initInstance({
|
|
253
257
|
redisClientConfig,
|
|
254
258
|
cacheClient,
|
|
@@ -260,6 +264,7 @@ declare abstract class ScriptManager<T extends string, S extends ScriptManager<T
|
|
|
260
264
|
protected abstract additionalInitialization(...args: unknown[]): Promise<void>;
|
|
261
265
|
protected setupReconnectHandler(): void;
|
|
262
266
|
protected reloadScripts(): Promise<void>;
|
|
267
|
+
private performReload;
|
|
263
268
|
protected loadScripts(scripts: Scripts<T>, scriptMap?: Map<T, string>): Promise<void>;
|
|
264
269
|
protected executeScript<U>(method: T, keys: string[], args: string[]): Promise<U | null>;
|
|
265
270
|
protected isRedisReady(): boolean;
|
package/dist/index.d.mts
CHANGED
|
@@ -149,6 +149,7 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
149
149
|
args: string[];
|
|
150
150
|
}): Promise<T | null>;
|
|
151
151
|
loadScript?(script: string): Promise<string | null>;
|
|
152
|
+
scriptExists?(shas: string[]): Promise<boolean[]>;
|
|
152
153
|
increment?(key: string, cacheTTL: number): Promise<number | null>;
|
|
153
154
|
decrement?(key: string, cacheTTL: number): Promise<number | null>;
|
|
154
155
|
subscribe?<T extends boolean = false>(pattern: string, listener: PubSubListener<T>): Promise<boolean>;
|
|
@@ -206,6 +207,7 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
206
207
|
args: string[];
|
|
207
208
|
}): Promise<T | null>;
|
|
208
209
|
loadScript(script: string): Promise<string | null>;
|
|
210
|
+
scriptExists(shas: string[]): Promise<boolean[]>;
|
|
209
211
|
increment(key: string, cacheTTL: number): Promise<number | null>;
|
|
210
212
|
decrement(key: string, cacheTTL: number): Promise<number | null>;
|
|
211
213
|
subscribe<T extends boolean>(pattern: string, listener: PubSubListener<T>): Promise<boolean>;
|
|
@@ -248,6 +250,8 @@ declare abstract class ScriptManager<T extends string, S extends ScriptManager<T
|
|
|
248
250
|
protected logger: ILogger;
|
|
249
251
|
protected additionalArgs: unknown[];
|
|
250
252
|
protected isInitialConnection: boolean;
|
|
253
|
+
protected reloadInProgress: Promise<void> | null;
|
|
254
|
+
protected lastReloadTime: number;
|
|
251
255
|
protected initInstance({
|
|
252
256
|
redisClientConfig,
|
|
253
257
|
cacheClient,
|
|
@@ -259,6 +263,7 @@ declare abstract class ScriptManager<T extends string, S extends ScriptManager<T
|
|
|
259
263
|
protected abstract additionalInitialization(...args: unknown[]): Promise<void>;
|
|
260
264
|
protected setupReconnectHandler(): void;
|
|
261
265
|
protected reloadScripts(): Promise<void>;
|
|
266
|
+
private performReload;
|
|
262
267
|
protected loadScripts(scripts: Scripts<T>, scriptMap?: Map<T, string>): Promise<void>;
|
|
263
268
|
protected executeScript<U>(method: T, keys: string[], args: string[]): Promise<U | null>;
|
|
264
269
|
protected isRedisReady(): boolean;
|