@stackone/transport 2.45.1 → 2.45.3
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 +3 -3
- package/dist/index.d.cts +7 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.mjs +3 -3
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,8 @@ declare abstract class AsyncSingleton<T, O> {
|
|
|
15
15
|
private status;
|
|
16
16
|
private initOptions;
|
|
17
17
|
private initArgs;
|
|
18
|
+
private generation;
|
|
19
|
+
private attempts;
|
|
18
20
|
protected abstract initInstance(options: O | null, ...args: unknown[]): Promise<T>;
|
|
19
21
|
protected abstract name: string;
|
|
20
22
|
protected getRetryDelay(): number;
|
|
@@ -24,6 +26,8 @@ declare abstract class AsyncSingleton<T, O> {
|
|
|
24
26
|
isReady(): boolean;
|
|
25
27
|
hasInitFailed(): boolean;
|
|
26
28
|
private init;
|
|
29
|
+
private failInit;
|
|
30
|
+
protected disposeStaleInstance(_instance: T): void;
|
|
27
31
|
reset(): void;
|
|
28
32
|
}
|
|
29
33
|
interface ICacheClient<ClientType = unknown> {
|
|
@@ -88,12 +92,13 @@ interface RedisClientConfig {
|
|
|
88
92
|
connectTimeout?: number;
|
|
89
93
|
initialConnectTimeout?: number;
|
|
90
94
|
pingInterval?: number;
|
|
95
|
+
pingTimeout?: number;
|
|
91
96
|
}
|
|
92
97
|
type RedisClientBuilder = (config: RedisClientConfig, logger?: ILogger, invoker?: string) => Promise<ICacheClient<RedisClientType> | undefined>;
|
|
93
98
|
declare const buildRedisClientInstance: (config: RedisClientConfig, logger?: ILogger, invoker?: string) => Promise<ICacheClient<RedisClientType> | undefined>;
|
|
94
99
|
export declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
95
100
|
#private;
|
|
96
|
-
static build({ getRedisClient, host, port, tls, keepAlive, reconnect, database, connectTimeout, initialConnectTimeout, pingInterval }: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
101
|
+
static build({ getRedisClient, host, port, tls, keepAlive, reconnect, database, connectTimeout, initialConnectTimeout, pingInterval, pingTimeout }: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
97
102
|
getData<T>(key: string): Promise<T | null>;
|
|
98
103
|
getDataBatch<T>(keys: string[]): Promise<(T | null)[]>;
|
|
99
104
|
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
@@ -175,6 +180,7 @@ export declare abstract class ScriptManager<T extends string, S extends ScriptMa
|
|
|
175
180
|
protected unavailableLogThrottle: LogThrottle;
|
|
176
181
|
protected initInstance({ redisClientConfig, cacheClient, scripts, scriptMap, logger, additionalArgs }: ScriptManagerOptions<T>): Promise<S>;
|
|
177
182
|
protected closeCacheClient(): void;
|
|
183
|
+
protected disposeStaleInstance(): void;
|
|
178
184
|
protected abstract additionalInitialization(...args: unknown[]): Promise<void>;
|
|
179
185
|
protected releaseAdditionalResources(): void;
|
|
180
186
|
protected setupReconnectHandler(): void;
|
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,8 @@ declare abstract class AsyncSingleton<T, O> {
|
|
|
15
15
|
private status;
|
|
16
16
|
private initOptions;
|
|
17
17
|
private initArgs;
|
|
18
|
+
private generation;
|
|
19
|
+
private attempts;
|
|
18
20
|
protected abstract initInstance(options: O | null, ...args: unknown[]): Promise<T>;
|
|
19
21
|
protected abstract name: string;
|
|
20
22
|
protected getRetryDelay(): number;
|
|
@@ -24,6 +26,8 @@ declare abstract class AsyncSingleton<T, O> {
|
|
|
24
26
|
isReady(): boolean;
|
|
25
27
|
hasInitFailed(): boolean;
|
|
26
28
|
private init;
|
|
29
|
+
private failInit;
|
|
30
|
+
protected disposeStaleInstance(_instance: T): void;
|
|
27
31
|
reset(): void;
|
|
28
32
|
}
|
|
29
33
|
interface ICacheClient<ClientType = unknown> {
|
|
@@ -88,12 +92,13 @@ interface RedisClientConfig {
|
|
|
88
92
|
connectTimeout?: number;
|
|
89
93
|
initialConnectTimeout?: number;
|
|
90
94
|
pingInterval?: number;
|
|
95
|
+
pingTimeout?: number;
|
|
91
96
|
}
|
|
92
97
|
type RedisClientBuilder = (config: RedisClientConfig, logger?: ILogger, invoker?: string) => Promise<ICacheClient<RedisClientType> | undefined>;
|
|
93
98
|
declare const buildRedisClientInstance: (config: RedisClientConfig, logger?: ILogger, invoker?: string) => Promise<ICacheClient<RedisClientType> | undefined>;
|
|
94
99
|
export declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
95
100
|
#private;
|
|
96
|
-
static build({ getRedisClient, host, port, tls, keepAlive, reconnect, database, connectTimeout, initialConnectTimeout, pingInterval }: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
101
|
+
static build({ getRedisClient, host, port, tls, keepAlive, reconnect, database, connectTimeout, initialConnectTimeout, pingInterval, pingTimeout }: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
97
102
|
getData<T>(key: string): Promise<T | null>;
|
|
98
103
|
getDataBatch<T>(keys: string[]): Promise<(T | null)[]>;
|
|
99
104
|
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
@@ -175,6 +180,7 @@ export declare abstract class ScriptManager<T extends string, S extends ScriptMa
|
|
|
175
180
|
protected unavailableLogThrottle: LogThrottle;
|
|
176
181
|
protected initInstance({ redisClientConfig, cacheClient, scripts, scriptMap, logger, additionalArgs }: ScriptManagerOptions<T>): Promise<S>;
|
|
177
182
|
protected closeCacheClient(): void;
|
|
183
|
+
protected disposeStaleInstance(): void;
|
|
178
184
|
protected abstract additionalInitialization(...args: unknown[]): Promise<void>;
|
|
179
185
|
protected releaseAdditionalResources(): void;
|
|
180
186
|
protected setupReconnectHandler(): void;
|